diff options
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/migrations/0340-add-originally-published-at.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/server/initializers/migrations/0340-add-originally-published-at.ts b/server/initializers/migrations/0340-add-originally-published-at.ts index ab8d66854..fe4f4a5f9 100644 --- a/server/initializers/migrations/0340-add-originally-published-at.ts +++ b/server/initializers/migrations/0340-add-originally-published-at.ts | |||
@@ -6,19 +6,13 @@ async function up (utils: { | |||
6 | sequelize: Sequelize.Sequelize | 6 | sequelize: Sequelize.Sequelize |
7 | }): Promise<void> { | 7 | }): Promise<void> { |
8 | 8 | ||
9 | { | 9 | const data = { |
10 | const data = { | 10 | type: Sequelize.DATE, |
11 | type: Sequelize.DATE, | 11 | allowNull: true, |
12 | allowNull: true, | 12 | defaultValue: null |
13 | defaultValue: Sequelize.NOW | ||
14 | } | ||
15 | await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data) | ||
16 | } | 13 | } |
14 | await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data) | ||
17 | 15 | ||
18 | { | ||
19 | const query = 'UPDATE video SET "originallyPublishedAt" = video."publishedAt"' | ||
20 | await utils.sequelize.query(query) | ||
21 | } | ||
22 | } | 16 | } |
23 | 17 | ||
24 | function down (options) { | 18 | function down (options) { |