From: Chocobozzz Date: Fri, 30 Mar 2018 15:47:21 +0000 (+0200) Subject: Fix migration 200 X-Git-Tag: v1.0.0-beta.4~103 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=79d28db3f916d53a6c22509ecef77588b1930be6;p=oweals%2Fpeertube.git Fix migration 200 --- 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: { { const data = { type: Sequelize.DATE, - allowNull: false, + allowNull: true, defaultValue: Sequelize.NOW } await utils.queryInterface.addColumn('video', 'publishedAt', data) @@ -20,6 +20,16 @@ async function up (utils: { await utils.sequelize.query(query) } + // Sequelize does not alter the column with NOW as default value + { + const data = { + type: Sequelize.DATE, + allowNull: false, + defaultValue: Sequelize.NOW + } + await utils.queryInterface.changeColumn('video', 'publishedAt', data) + } + } function down (options) {