From 6fd8c4da261ce12aeaa2a4d75e8eec1a43592784 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jan 2020 10:41:05 +0100 Subject: Cleanup DB indexes --- .../initializers/migrations/0470-cleaup-indexes.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 server/initializers/migrations/0470-cleaup-indexes.ts (limited to 'server/initializers/migrations/0470-cleaup-indexes.ts') diff --git a/server/initializers/migrations/0470-cleaup-indexes.ts b/server/initializers/migrations/0470-cleaup-indexes.ts new file mode 100644 index 000000000..53e401c2b --- /dev/null +++ b/server/initializers/migrations/0470-cleaup-indexes.ts @@ -0,0 +1,22 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: any +}): Promise { + await utils.sequelize.query('DROP INDEX IF EXISTS video_share_account_id;') + await utils.sequelize.query('DROP INDEX IF EXISTS video_published_at;') + + await utils.sequelize.query('ALTER TABLE "avatar" DROP COLUMN IF EXISTS "avatarId"') +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3