diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-25 11:04:18 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-25 11:07:56 +0100 |
commit | 18490b07650d77d7fe376970b749af5a8c672fd6 (patch) | |
tree | 89741e63e34c2659487c9afa8309755064cb0c39 /server/initializers/migrations | |
parent | 5beb89f223539f1e415a976ff104f772526b4d20 (diff) | |
download | PeerTube-18490b07650d77d7fe376970b749af5a8c672fd6.tar.gz PeerTube-18490b07650d77d7fe376970b749af5a8c672fd6.tar.zst PeerTube-18490b07650d77d7fe376970b749af5a8c672fd6.zip |
Fix migration and test
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 | ||
33 | function down (options) { | 44 | function down (options) { |