Browse Source

Fix old DB enum names

tags/v4.3.0
Chocobozzz 1 week ago
parent
commit
db312c7023
No known key found for this signature in database GPG Key ID: 583A612D890159BE
2 changed files with 34 additions and 1 deletions
  1. +1
    -1
      server/initializers/constants.ts
  2. +33
    -0
      server/initializers/migrations/0740-fix-old-enums.ts

+ 1
- 1
server/initializers/constants.ts View File

@@ -25,7 +25,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'

// ---------------------------------------------------------------------------

const LAST_MIGRATION_VERSION = 735
const LAST_MIGRATION_VERSION = 740

// ---------------------------------------------------------------------------



+ 33
- 0
server/initializers/migrations/0740-fix-old-enums.ts View File

@@ -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<void> {
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
}

Loading…
Cancel
Save