aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrator.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-08-25 11:36:23 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-08-25 11:36:23 +0200
commit93e1258c7cbc0d1235ca6d2a1f7c1875985328b8 (patch)
treeb0a1f77af7ab54dc5f58f569fcd1e9d84b04c533 /server/initializers/migrator.ts
parent69f224587e99d56008e1fa129d0641840a486620 (diff)
downloadPeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.gz
PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.zst
PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.zip
Move video file metadata in their own table
Will be used for user video quotas and multiple video resolutions
Diffstat (limited to 'server/initializers/migrator.ts')
-rw-r--r--server/initializers/migrator.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts
index 71a656c59..7b535aea9 100644
--- a/server/initializers/migrator.ts
+++ b/server/initializers/migrator.ts
@@ -64,14 +64,16 @@ function getMigrationScripts () {
64 script: string 64 script: string
65 }[] = [] 65 }[] = []
66 66
67 files.forEach(file => { 67 files
68 // Filename is something like 'version-blabla.js' 68 .filter(file => file.endsWith('.js.map') === false)
69 const version = file.split('-')[0] 69 .forEach(file => {
70 filesToMigrate.push({ 70 // Filename is something like 'version-blabla.js'
71 version, 71 const version = file.split('-')[0]
72 script: file 72 filesToMigrate.push({
73 version,
74 script: file
75 })
73 }) 76 })
74 })
75 77
76 return filesToMigrate 78 return filesToMigrate
77 }) 79 })
@@ -93,7 +95,8 @@ function executeMigration (actualVersion: number, entity: { version: string, scr
93 const options = { 95 const options = {
94 transaction: t, 96 transaction: t,
95 queryInterface: db.sequelize.getQueryInterface(), 97 queryInterface: db.sequelize.getQueryInterface(),
96 sequelize: db.sequelize 98 sequelize: db.sequelize,
99 db
97 } 100 }
98 101
99 return migrationScript.up(options) 102 return migrationScript.up(options)