Apply code style from .eslintrc to migrations
parent
d89b27d9b1
commit
9df221aa02
|
@ -1,15 +1,15 @@
|
|||
exports.up = async function (knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
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_name', 128).nullable().defaultTo(null).after('channel_id');
|
||||
await knex.schema.table("threads", table => {
|
||||
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_name", 128).nullable().defaultTo(null).after("channel_id");
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.dropColumn('scheduled_close_at');
|
||||
table.dropColumn('scheduled_close_id');
|
||||
table.dropColumn('scheduled_close_name');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.dropColumn("scheduled_close_at");
|
||||
table.dropColumn("scheduled_close_id");
|
||||
table.dropColumn("scheduled_close_name");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
exports.up = async function (knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.string('alert_id', 20).nullable().defaultTo(null).after('scheduled_close_name');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.string("alert_id", 20).nullable().defaultTo(null).after("scheduled_close_name");
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.dropColumn('alert_id');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.dropColumn("alert_id");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
exports.up = async function (knex, Promise) {
|
||||
await knex.schema.table('snippets', table => {
|
||||
table.dropColumn('is_anonymous');
|
||||
await knex.schema.table("snippets", table => {
|
||||
table.dropColumn("is_anonymous");
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('snippets', table => {
|
||||
table.integer('is_anonymous').unsigned().notNullable();
|
||||
await knex.schema.table("snippets", table => {
|
||||
table.integer("is_anonymous").unsigned().notNullable();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
exports.up = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.integer('scheduled_close_silent').nullable().after('scheduled_close_name');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.integer("scheduled_close_silent").nullable().after("scheduled_close_name");
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.dropColumn('scheduled_close_silent');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.dropColumn("scheduled_close_silent");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
exports.up = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
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_name', 128).nullable().defaultTo(null).after('channel_id');
|
||||
await knex.schema.table("threads", table => {
|
||||
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_name", 128).nullable().defaultTo(null).after("channel_id");
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('threads', table => {
|
||||
table.dropColumn('scheduled_suspend_at');
|
||||
table.dropColumn('scheduled_suspend_id');
|
||||
table.dropColumn('scheduled_suspend_name');
|
||||
await knex.schema.table("threads", table => {
|
||||
table.dropColumn("scheduled_suspend_at");
|
||||
table.dropColumn("scheduled_suspend_id");
|
||||
table.dropColumn("scheduled_suspend_name");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
exports.up = async function(knex, Promise) {
|
||||
if (! await knex.schema.hasTable('updates')) {
|
||||
await knex.schema.createTable('updates', table => {
|
||||
table.string('available_version', 16).nullable();
|
||||
table.dateTime('last_checked').nullable();
|
||||
if (! await knex.schema.hasTable("updates")) {
|
||||
await knex.schema.createTable("updates", table => {
|
||||
table.string("available_version", 16).nullable();
|
||||
table.dateTime("last_checked").nullable();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
if (await knex.schema.hasTable('updates')) {
|
||||
await knex.schema.dropTable('updates');
|
||||
if (await knex.schema.hasTable("updates")) {
|
||||
await knex.schema.dropTable("updates");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
exports.up = async function(knex, Promise) {
|
||||
await knex.schema.table('blocked_users', table => {
|
||||
table.dateTime('expires_at').nullable();
|
||||
await knex.schema.table("blocked_users", table => {
|
||||
table.dateTime("expires_at").nullable();
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex, Promise) {
|
||||
await knex.schema.table('blocked_users', table => {
|
||||
table.dropColumn('expires_at');
|
||||
await knex.schema.table("blocked_users", table => {
|
||||
table.dropColumn("expires_at");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
const Knex = require('knex');
|
||||
const Knex = require("knex");
|
||||
|
||||
/**
|
||||
* @param {Knex} knex
|
||||
*/
|
||||
exports.up = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.integer('message_number').unsigned().nullable();
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.integer("message_number").unsigned().nullable();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ exports.up = async function(knex) {
|
|||
* @param {Knex} knex
|
||||
*/
|
||||
exports.down = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.dropColumn('message_number');
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.dropColumn("message_number");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
const Knex = require('knex');
|
||||
const Knex = require("knex");
|
||||
|
||||
/**
|
||||
* @param {Knex} knex
|
||||
*/
|
||||
exports.up = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.string('inbox_message_id', 20).nullable().unique();
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.string("inbox_message_id", 20).nullable().unique();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ exports.up = async function(knex) {
|
|||
* @param {Knex} knex
|
||||
*/
|
||||
exports.down = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.dropColumn('inbox_message_id');
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.dropColumn("inbox_message_id");
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
const Knex = require('knex');
|
||||
const Knex = require("knex");
|
||||
|
||||
/**
|
||||
* @param {Knex} knex
|
||||
*/
|
||||
exports.up = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.string('dm_channel_id', 20).nullable();
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.string("dm_channel_id", 20).nullable();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ exports.up = async function(knex) {
|
|||
* @param {Knex} knex
|
||||
*/
|
||||
exports.down = async function(knex) {
|
||||
await knex.schema.table('thread_messages', table => {
|
||||
table.dropColumn('dm_channel_id');
|
||||
await knex.schema.table("thread_messages", table => {
|
||||
table.dropColumn("dm_channel_id");
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue