]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - server/initializers/migrations/0740-fix-old-enums.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0740-fix-old-enums.ts
... / ...
CommitLineData
1import * as Sequelize from 'sequelize'
2
3async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7 db: any
8}): Promise<void> {
9 try {
10 await utils.sequelize.query('drop type "enum_actorFollow_state"')
11 await utils.sequelize.query('alter type "enum_AccountFollows_state" rename to "enum_actorFollow_state";')
12 } catch {
13 // empty
14 }
15
16 try {
17 await utils.sequelize.query('drop type "enum_accountVideoRate_type"')
18 await utils.sequelize.query('alter type "enum_AccountVideoRates_type" rename to "enum_accountVideoRate_type";')
19 } catch {
20 // empty
21 }
22}
23
24async function down (utils: {
25 queryInterface: Sequelize.QueryInterface
26 transaction: Sequelize.Transaction
27}) {
28}
29
30export {
31 up,
32 down
33}