aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0740-fix-old-enums.ts
blob: 501d0ccb2f4b48044ab0691e61e3c71dac39328b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
}