aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-19 09:27:14 +0200
committerChocobozzz <me@florianbigard.com>2021-08-19 09:27:14 +0200
commite5d3e0c79d30f7b1a9d744dca027f325d29c4ae3 (patch)
tree8c564c243b2c7f886f995b6e9f036ccc691e20aa
parent2e80d256cc75b4b02c8efc3d3e4cdf57ddf401a8 (diff)
downloadPeerTube-e5d3e0c79d30f7b1a9d744dca027f325d29c4ae3.tar.gz
PeerTube-e5d3e0c79d30f7b1a9d744dca027f325d29c4ae3.tar.zst
PeerTube-e5d3e0c79d30f7b1a9d744dca027f325d29c4ae3.zip
Fix object storage migration
It's too long on big instances
-rw-r--r--server/initializers/migrations/0660-object-storage.ts34
1 files changed, 16 insertions, 18 deletions
diff --git a/server/initializers/migrations/0660-object-storage.ts b/server/initializers/migrations/0660-object-storage.ts
index c815c71c6..53cb89ce6 100644
--- a/server/initializers/migrations/0660-object-storage.ts
+++ b/server/initializers/migrations/0660-object-storage.ts
@@ -24,27 +24,25 @@ async function up (utils: {
24 } 24 }
25 25
26 { 26 {
27 await utils.queryInterface.addColumn('videoFile', 'storage', { type: Sequelize.INTEGER, allowNull: true }) 27 await utils.queryInterface.addColumn('videoFile', 'storage', {
28 } 28 type: Sequelize.INTEGER,
29 { 29 allowNull: true,
30 await utils.sequelize.query( 30 defaultValue: VideoStorage.FILE_SYSTEM
31 `UPDATE "videoFile" SET "storage" = ${VideoStorage.FILE_SYSTEM}` 31 })
32 ) 32 await utils.queryInterface.changeColumn('videoFile', 'storage', { type: Sequelize.INTEGER, allowNull: false, defaultValue: null })
33 }
34 {
35 await utils.queryInterface.changeColumn('videoFile', 'storage', { type: Sequelize.INTEGER, allowNull: false })
36 } 33 }
37 34
38 { 35 {
39 await utils.queryInterface.addColumn('videoStreamingPlaylist', 'storage', { type: Sequelize.INTEGER, allowNull: true }) 36 await utils.queryInterface.addColumn('videoStreamingPlaylist', 'storage', {
40 } 37 type: Sequelize.INTEGER,
41 { 38 allowNull: true,
42 await utils.sequelize.query( 39 defaultValue: VideoStorage.FILE_SYSTEM
43 `UPDATE "videoStreamingPlaylist" SET "storage" = ${VideoStorage.FILE_SYSTEM}` 40 })
44 ) 41 await utils.queryInterface.changeColumn('videoStreamingPlaylist', 'storage', {
45 } 42 type: Sequelize.INTEGER,
46 { 43 allowNull: false,
47 await utils.queryInterface.changeColumn('videoStreamingPlaylist', 'storage', { type: Sequelize.INTEGER, allowNull: false }) 44 defaultValue: null
45 })
48 } 46 }
49} 47}
50 48