aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0340-add-originally-published-at.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 14:33:47 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 14:33:47 +0100
commit6913f69134947432a192890b2de7c2d48094e85c (patch)
treec741ecbea6fdeb67a3eb2a6c9581a9925feac220 /server/initializers/migrations/0340-add-originally-published-at.ts
parentb718fd22374d64534bcfe69932cf562894abed6a (diff)
downloadPeerTube-6913f69134947432a192890b2de7c2d48094e85c.tar.gz
PeerTube-6913f69134947432a192890b2de7c2d48094e85c.tar.zst
PeerTube-6913f69134947432a192890b2de7c2d48094e85c.zip
Move original publication date in advanced settings
Diffstat (limited to 'server/initializers/migrations/0340-add-originally-published-at.ts')
-rw-r--r--server/initializers/migrations/0340-add-originally-published-at.ts16
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
24function down (options) { 18function down (options) {