diff options
Diffstat (limited to 'src/api/database')
| -rw-r--r-- | src/api/database/migrations/20190221225812_initialMigration.js | 24 | ||||
| -rw-r--r-- | src/api/database/migrations/20190221225813_addTags.js | 21 |
2 files changed, 24 insertions, 21 deletions
diff --git a/src/api/database/migrations/20190221225812_initialMigration.js b/src/api/database/migrations/20190221225812_initialMigration.js index a9ce2c7..84bda7e 100644 --- a/src/api/database/migrations/20190221225812_initialMigration.js +++ b/src/api/database/migrations/20190221225812_initialMigration.js @@ -62,6 +62,27 @@ exports.up = async knex => { table.integer('albumId'); table.integer('linkId'); }); + + await knex.schema.createTable('tags', table => { + table.increments(); + table.string('uuid'); + table.integer('userId'); + table.string('name'); + table.timestamp('createdAt'); + table.timestamp('editedAt'); + }); + + await knex.schema.createTable('fileTags', table => { + table.increments(); + table.integer('fileId'); + table.integer('tagId'); + }); + + await knex.schema.createTable('bans', table => { + table.increments(); + table.string('ip'); + table.timestamp('createdAt'); + }); }; exports.down = async knex => { await knex.schema.dropTableIfExists('users'); @@ -70,4 +91,7 @@ exports.down = async knex => { await knex.schema.dropTableIfExists('links'); await knex.schema.dropTableIfExists('albumsFiles'); await knex.schema.dropTableIfExists('albumsLinks'); + await knex.schema.dropTableIfExists('tags'); + await knex.schema.dropTableIfExists('fileTags'); + await knex.schema.dropTableIfExists('bans'); }; diff --git a/src/api/database/migrations/20190221225813_addTags.js b/src/api/database/migrations/20190221225813_addTags.js deleted file mode 100644 index ef71877..0000000 --- a/src/api/database/migrations/20190221225813_addTags.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.up = async knex => { - await knex.schema.createTable('tags', table => { - table.increments(); - table.string('uuid'); - table.integer('userId'); - table.string('name'); - table.timestamp('createdAt'); - table.timestamp('editedAt'); - }); - - await knex.schema.createTable('fileTags', table => { - table.increments(); - table.integer('fileId'); - table.integer('tagId'); - }); -}; - -exports.down = async knex => { - await knex.schema.dropTableIfExists('tags'); - await knex.schema.dropTableIfExists('fileTags'); -}; |