From db312c7023bb8263741255f8af1c8a6aef5f88f7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Sep 2022 15:22:02 +0200 Subject: Fix old DB enum names --- .../initializers/migrations/0740-fix-old-enums.ts | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 server/initializers/migrations/0740-fix-old-enums.ts (limited to 'server/initializers/migrations/0740-fix-old-enums.ts') diff --git a/server/initializers/migrations/0740-fix-old-enums.ts b/server/initializers/migrations/0740-fix-old-enums.ts new file mode 100644 index 000000000..501d0ccb2 --- /dev/null +++ b/server/initializers/migrations/0740-fix-old-enums.ts @@ -0,0 +1,33 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction + queryInterface: Sequelize.QueryInterface + sequelize: Sequelize.Sequelize + db: any +}): Promise { + try { + await utils.sequelize.query('drop type "enum_actorFollow_state"') + await utils.sequelize.query('alter type "enum_AccountFollows_state" rename to "enum_actorFollow_state";') + } catch { + // empty + } + + try { + await utils.sequelize.query('drop type "enum_accountVideoRate_type"') + await utils.sequelize.query('alter type "enum_AccountVideoRates_type" rename to "enum_accountVideoRate_type";') + } catch { + // empty + } +} + +async function down (utils: { + queryInterface: Sequelize.QueryInterface + transaction: Sequelize.Transaction +}) { +} + +export { + up, + down +} -- cgit v1.2.3