From: Chocobozzz Date: Fri, 10 Jan 2020 09:41:05 +0000 (+0100) Subject: Cleanup DB indexes X-Git-Tag: v2.1.0-rc.1~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6fd8c4da261ce12aeaa2a4d75e8eec1a43592784;p=oweals%2Fpeertube.git Cleanup DB indexes --- diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 8461c7320..d4ac8bbbe 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 465 +const LAST_MIGRATION_VERSION = 470 // --------------------------------------------------------------------------- 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 +}