aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/initializers/migrations/0560-user-feed-token.ts (renamed from server/initializers/migrations/0530-user-feed-token.ts)23
2 files changed, 18 insertions, 7 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 945185f62..6c44d703e 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
24 24
25// --------------------------------------------------------------------------- 25// ---------------------------------------------------------------------------
26 26
27const LAST_MIGRATION_VERSION = 555 27const LAST_MIGRATION_VERSION = 560
28 28
29// --------------------------------------------------------------------------- 29// ---------------------------------------------------------------------------
30 30
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) {