aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0560-user-feed-token.ts (renamed from server/initializers/migrations/0530-user-feed-token.ts)23
1 files changed, 17 insertions, 6 deletions
diff --git a/server/initializers/migrations/0530-user-feed-token.ts b/server/initializers/migrations/0560-user-feed-token.ts
index 421016b11..7c61def17 100644
--- a/server/initializers/migrations/0530-user-feed-token.ts
+++ b/server/initializers/migrations/0560-user-feed-token.ts
@@ -9,13 +9,15 @@ async function up (utils: {
9}): Promise<void> { 9}): Promise<void> {
10 const q = utils.queryInterface 10 const q = utils.queryInterface
11 11
12 // Create uuid column for users 12 {
13 const userFeedTokenUUID = { 13 // Create uuid column for users
14 type: Sequelize.UUID, 14 const userFeedTokenUUID = {
15 defaultValue: Sequelize.UUIDV4, 15 type: Sequelize.UUID,
16 allowNull: true 16 defaultValue: Sequelize.UUIDV4,
17 allowNull: true
18 }
19 await q.addColumn('user', 'feedToken', userFeedTokenUUID)
17 } 20 }
18 await q.addColumn('user', 'feedToken', userFeedTokenUUID)
19 21
20 // Set UUID to previous users 22 // Set UUID to previous users
21 { 23 {
@@ -28,6 +30,15 @@ async function up (utils: {
28 await utils.sequelize.query(queryUpdate) 30 await utils.sequelize.query(queryUpdate)
29 } 31 }
30 } 32 }
33
34 {
35 const userFeedTokenUUID = {
36 type: Sequelize.UUID,
37 defaultValue: Sequelize.UUIDV4,
38 allowNull: false
39 }
40 await q.changeColumn('user', 'feedToken', userFeedTokenUUID)
41 }
31} 42}
32 43
33function down (options) { 44function down (options) {