Apply code style from .eslintrc to migrations

cshd
Dragory 2020-08-13 03:38:24 +03:00
parent d89b27d9b1
commit 9df221aa02
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
10 changed files with 53 additions and 53 deletions

View File

@ -1,15 +1,15 @@
exports.up = async function (knex, Promise) { exports.up = async function (knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dateTime('scheduled_close_at').index().nullable().defaultTo(null).after('channel_id'); table.dateTime("scheduled_close_at").index().nullable().defaultTo(null).after("channel_id");
table.string('scheduled_close_id', 20).nullable().defaultTo(null).after('channel_id'); table.string("scheduled_close_id", 20).nullable().defaultTo(null).after("channel_id");
table.string('scheduled_close_name', 128).nullable().defaultTo(null).after('channel_id'); table.string("scheduled_close_name", 128).nullable().defaultTo(null).after("channel_id");
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dropColumn('scheduled_close_at'); table.dropColumn("scheduled_close_at");
table.dropColumn('scheduled_close_id'); table.dropColumn("scheduled_close_id");
table.dropColumn('scheduled_close_name'); table.dropColumn("scheduled_close_name");
}); });
}; };

View File

@ -1,11 +1,11 @@
exports.up = async function (knex, Promise) { exports.up = async function (knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.string('alert_id', 20).nullable().defaultTo(null).after('scheduled_close_name'); table.string("alert_id", 20).nullable().defaultTo(null).after("scheduled_close_name");
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dropColumn('alert_id'); table.dropColumn("alert_id");
}); });
}; };

View File

@ -1,11 +1,11 @@
exports.up = async function (knex, Promise) { exports.up = async function (knex, Promise) {
await knex.schema.table('snippets', table => { await knex.schema.table("snippets", table => {
table.dropColumn('is_anonymous'); table.dropColumn("is_anonymous");
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('snippets', table => { await knex.schema.table("snippets", table => {
table.integer('is_anonymous').unsigned().notNullable(); table.integer("is_anonymous").unsigned().notNullable();
}); });
}; };

View File

@ -1,11 +1,11 @@
exports.up = async function(knex, Promise) { exports.up = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.integer('scheduled_close_silent').nullable().after('scheduled_close_name'); table.integer("scheduled_close_silent").nullable().after("scheduled_close_name");
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dropColumn('scheduled_close_silent'); table.dropColumn("scheduled_close_silent");
}); });
}; };

View File

@ -1,15 +1,15 @@
exports.up = async function(knex, Promise) { exports.up = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dateTime('scheduled_suspend_at').index().nullable().defaultTo(null).after('channel_id'); table.dateTime("scheduled_suspend_at").index().nullable().defaultTo(null).after("channel_id");
table.string('scheduled_suspend_id', 20).nullable().defaultTo(null).after('channel_id'); table.string("scheduled_suspend_id", 20).nullable().defaultTo(null).after("channel_id");
table.string('scheduled_suspend_name', 128).nullable().defaultTo(null).after('channel_id'); table.string("scheduled_suspend_name", 128).nullable().defaultTo(null).after("channel_id");
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('threads', table => { await knex.schema.table("threads", table => {
table.dropColumn('scheduled_suspend_at'); table.dropColumn("scheduled_suspend_at");
table.dropColumn('scheduled_suspend_id'); table.dropColumn("scheduled_suspend_id");
table.dropColumn('scheduled_suspend_name'); table.dropColumn("scheduled_suspend_name");
}); });
}; };

View File

@ -1,14 +1,14 @@
exports.up = async function(knex, Promise) { exports.up = async function(knex, Promise) {
if (! await knex.schema.hasTable('updates')) { if (! await knex.schema.hasTable("updates")) {
await knex.schema.createTable('updates', table => { await knex.schema.createTable("updates", table => {
table.string('available_version', 16).nullable(); table.string("available_version", 16).nullable();
table.dateTime('last_checked').nullable(); table.dateTime("last_checked").nullable();
}); });
} }
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
if (await knex.schema.hasTable('updates')) { if (await knex.schema.hasTable("updates")) {
await knex.schema.dropTable('updates'); await knex.schema.dropTable("updates");
} }
}; };

View File

@ -1,11 +1,11 @@
exports.up = async function(knex, Promise) { exports.up = async function(knex, Promise) {
await knex.schema.table('blocked_users', table => { await knex.schema.table("blocked_users", table => {
table.dateTime('expires_at').nullable(); table.dateTime("expires_at").nullable();
}); });
}; };
exports.down = async function(knex, Promise) { exports.down = async function(knex, Promise) {
await knex.schema.table('blocked_users', table => { await knex.schema.table("blocked_users", table => {
table.dropColumn('expires_at'); table.dropColumn("expires_at");
}); });
}; };

View File

@ -1,11 +1,11 @@
const Knex = require('knex'); const Knex = require("knex");
/** /**
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.up = async function(knex) { exports.up = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.integer('message_number').unsigned().nullable(); table.integer("message_number").unsigned().nullable();
}); });
}; };
@ -13,7 +13,7 @@ exports.up = async function(knex) {
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.down = async function(knex) { exports.down = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.dropColumn('message_number'); table.dropColumn("message_number");
}); });
}; };

View File

@ -1,11 +1,11 @@
const Knex = require('knex'); const Knex = require("knex");
/** /**
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.up = async function(knex) { exports.up = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.string('inbox_message_id', 20).nullable().unique(); table.string("inbox_message_id", 20).nullable().unique();
}); });
}; };
@ -13,7 +13,7 @@ exports.up = async function(knex) {
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.down = async function(knex) { exports.down = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.dropColumn('inbox_message_id'); table.dropColumn("inbox_message_id");
}); });
}; };

View File

@ -1,11 +1,11 @@
const Knex = require('knex'); const Knex = require("knex");
/** /**
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.up = async function(knex) { exports.up = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.string('dm_channel_id', 20).nullable(); table.string("dm_channel_id", 20).nullable();
}); });
}; };
@ -13,7 +13,7 @@ exports.up = async function(knex) {
* @param {Knex} knex * @param {Knex} knex
*/ */
exports.down = async function(knex) { exports.down = async function(knex) {
await knex.schema.table('thread_messages', table => { await knex.schema.table("thread_messages", table => {
table.dropColumn('dm_channel_id'); table.dropColumn("dm_channel_id");
}); });
}; };