aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0200-video-published-at.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-30 17:47:21 +0200
committerChocobozzz <me@florianbigard.com>2018-03-30 17:47:21 +0200
commit79d28db3f916d53a6c22509ecef77588b1930be6 (patch)
tree7fc6f8697e42fb27fa7d1729128c49ae39d97618 /server/initializers/migrations/0200-video-published-at.ts
parentd788291d2aa0dd0241958b05f2aecff886b42149 (diff)
downloadPeerTube-79d28db3f916d53a6c22509ecef77588b1930be6.tar.gz
PeerTube-79d28db3f916d53a6c22509ecef77588b1930be6.tar.zst
PeerTube-79d28db3f916d53a6c22509ecef77588b1930be6.zip
Fix migration 200
Diffstat (limited to 'server/initializers/migrations/0200-video-published-at.ts')
-rw-r--r--server/initializers/migrations/0200-video-published-at.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/initializers/migrations/0200-video-published-at.ts b/server/initializers/migrations/0200-video-published-at.ts
index edaf4a145..1701ea07a 100644
--- a/server/initializers/migrations/0200-video-published-at.ts
+++ b/server/initializers/migrations/0200-video-published-at.ts
@@ -9,7 +9,7 @@ async function up (utils: {
9 { 9 {
10 const data = { 10 const data = {
11 type: Sequelize.DATE, 11 type: Sequelize.DATE,
12 allowNull: false, 12 allowNull: true,
13 defaultValue: Sequelize.NOW 13 defaultValue: Sequelize.NOW
14 } 14 }
15 await utils.queryInterface.addColumn('video', 'publishedAt', data) 15 await utils.queryInterface.addColumn('video', 'publishedAt', data)
@@ -20,6 +20,16 @@ async function up (utils: {
20 await utils.sequelize.query(query) 20 await utils.sequelize.query(query)
21 } 21 }
22 22
23 // Sequelize does not alter the column with NOW as default value
24 {
25 const data = {
26 type: Sequelize.DATE,
27 allowNull: false,
28 defaultValue: Sequelize.NOW
29 }
30 await utils.queryInterface.changeColumn('video', 'publishedAt', data)
31 }
32
23} 33}
24 34
25function down (options) { 35function down (options) {