diff options
| author | Pitu <[email protected]> | 2020-12-24 23:45:16 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2020-12-24 23:45:16 +0900 |
| commit | fb2c27086f570fec60f4d52dcc9ca80e53186293 (patch) | |
| tree | 4c4fd056c293b8e0de632023ef19fdea95c009fa /src/api/database | |
| parent | Merge pull request #228 from Zephyrrus/begone_trailing_commas (diff) | |
| download | host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.tar.xz host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.zip | |
Fix ESLint rules once and for all
Diffstat (limited to 'src/api/database')
| -rw-r--r-- | src/api/database/migrations/20190221225812_initialMigration.js | 22 | ||||
| -rw-r--r-- | src/api/database/seeds/initial.js | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/api/database/migrations/20190221225812_initialMigration.js b/src/api/database/migrations/20190221225812_initialMigration.js index b755a33..92103c1 100644 --- a/src/api/database/migrations/20190221225812_initialMigration.js +++ b/src/api/database/migrations/20190221225812_initialMigration.js @@ -1,5 +1,5 @@ -exports.up = async (knex) => { - await knex.schema.createTable('users', (table) => { +exports.up = async knex => { + await knex.schema.createTable('users', table => { table.increments(); table.string('username').unique(); table.text('password'); @@ -12,7 +12,7 @@ exports.up = async (knex) => { table.timestamp('editedAt'); }); - await knex.schema.createTable('albums', (table) => { + await knex.schema.createTable('albums', table => { table.increments(); table.integer('userId'); table.string('name'); @@ -24,7 +24,7 @@ exports.up = async (knex) => { table.unique(['userId', 'name']); }); - await knex.schema.createTable('files', (table) => { + await knex.schema.createTable('files', table => { table.increments(); table.integer('userId'); table.string('name'); @@ -38,7 +38,7 @@ exports.up = async (knex) => { table.timestamp('editedAt'); }); - await knex.schema.createTable('links', (table) => { + await knex.schema.createTable('links', table => { table.increments(); table.integer('userId'); table.integer('albumId'); @@ -53,7 +53,7 @@ exports.up = async (knex) => { table.unique(['userId', 'albumId', 'identifier']); }); - await knex.schema.createTable('albumsFiles', (table) => { + await knex.schema.createTable('albumsFiles', table => { table.increments(); table.integer('albumId'); table.integer('fileId'); @@ -61,13 +61,13 @@ exports.up = async (knex) => { table.unique(['albumId', 'fileId']); }); - await knex.schema.createTable('albumsLinks', (table) => { + await knex.schema.createTable('albumsLinks', table => { table.increments(); table.integer('albumId'); table.integer('linkId').unique(); }); - await knex.schema.createTable('tags', (table) => { + await knex.schema.createTable('tags', table => { table.increments(); table.string('uuid'); table.integer('userId'); @@ -78,7 +78,7 @@ exports.up = async (knex) => { table.unique(['userId', 'name']); }); - await knex.schema.createTable('fileTags', (table) => { + await knex.schema.createTable('fileTags', table => { table.increments(); table.integer('fileId'); table.integer('tagId'); @@ -86,13 +86,13 @@ exports.up = async (knex) => { table.unique(['fileId', 'tagId']); }); - await knex.schema.createTable('bans', (table) => { + await knex.schema.createTable('bans', table => { table.increments(); table.string('ip'); table.timestamp('createdAt'); }); }; -exports.down = async (knex) => { +exports.down = async knex => { await knex.schema.dropTableIfExists('users'); await knex.schema.dropTableIfExists('albums'); await knex.schema.dropTableIfExists('files'); diff --git a/src/api/database/seeds/initial.js b/src/api/database/seeds/initial.js index 2383a7b..edc1949 100644 --- a/src/api/database/seeds/initial.js +++ b/src/api/database/seeds/initial.js @@ -2,7 +2,7 @@ const bcrypt = require('bcrypt'); const moment = require('moment'); -exports.seed = async (db) => { +exports.seed = async db => { const now = moment.utc().toDate(); const user = await db.table('users').where({ username: process.env.ADMIN_ACCOUNT }).first(); if (user) return; |