aboutsummaryrefslogtreecommitdiff
path: root/src/api/database
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
committerZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
commitad852de51a0d2dd5d29c08838d5a430c58849e74 (patch)
treea4ab9a720f66271c9eba10916061a9b06c43656e /src/api/database
parentrefactor: refactor grid to use vuex for every action (diff)
downloadhost.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.tar.xz
host.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.zip
chore: linter the entire project using the new rules
Diffstat (limited to 'src/api/database')
-rw-r--r--src/api/database/migrations/20190221225812_initialMigration.js22
-rw-r--r--src/api/database/seeds/initial.js5
2 files changed, 14 insertions, 13 deletions
diff --git a/src/api/database/migrations/20190221225812_initialMigration.js b/src/api/database/migrations/20190221225812_initialMigration.js
index 4bcea8d..dd18ee5 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');
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');
@@ -22,7 +22,7 @@ exports.up = async knex => {
table.timestamp('editedAt');
});
- await knex.schema.createTable('files', table => {
+ await knex.schema.createTable('files', (table) => {
table.increments();
table.integer('userId');
table.string('name');
@@ -36,7 +36,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');
@@ -49,19 +49,19 @@ exports.up = async knex => {
table.timestamp('editedAt');
});
- await knex.schema.createTable('albumsFiles', table => {
+ await knex.schema.createTable('albumsFiles', (table) => {
table.increments();
table.integer('albumId');
table.integer('fileId');
});
- await knex.schema.createTable('albumsLinks', table => {
+ await knex.schema.createTable('albumsLinks', (table) => {
table.increments();
table.integer('albumId');
table.integer('linkId');
});
- await knex.schema.createTable('tags', table => {
+ await knex.schema.createTable('tags', (table) => {
table.increments();
table.string('uuid');
table.integer('userId');
@@ -70,19 +70,19 @@ exports.up = async knex => {
table.timestamp('editedAt');
});
- await knex.schema.createTable('fileTags', table => {
+ await knex.schema.createTable('fileTags', (table) => {
table.increments();
table.integer('fileId');
table.integer('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 280fd74..cdbfa80 100644
--- a/src/api/database/seeds/initial.js
+++ b/src/api/database/seeds/initial.js
@@ -1,7 +1,8 @@
+/* eslint-disable no-console */
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;
@@ -14,7 +15,7 @@ exports.seed = async db => {
createdAt: now,
editedAt: now,
enabled: true,
- isAdmin: true
+ isAdmin: true,
});
console.log();
console.log('=========================================================');