aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-25 09:44:57 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-25 09:44:57 +0100
commitb769007f733769d3afe2d29a3eb23e2e7693f301 (patch)
tree3816d542e907f298d08338129e0f6b9ca0df8fbb /server/initializers/constants.js
parentdd6019932efd6ae3b790bf024bc0cd74162e4517 (diff)
downloadPeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.tar.gz
PeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.tar.zst
PeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.zip
Update migrations code
Diffstat (limited to 'server/initializers/constants.js')
-rw-r--r--server/initializers/constants.js43
1 files changed, 5 insertions, 38 deletions
diff --git a/server/initializers/constants.js b/server/initializers/constants.js
index 1ad0c82a0..6f39b65da 100644
--- a/server/initializers/constants.js
+++ b/server/initializers/constants.js
@@ -37,7 +37,9 @@ const CONFIG = {
37 DATABASE: { 37 DATABASE: {
38 DBNAME: 'peertube' + config.get('database.suffix'), 38 DBNAME: 'peertube' + config.get('database.suffix'),
39 HOSTNAME: config.get('database.hostname'), 39 HOSTNAME: config.get('database.hostname'),
40 PORT: config.get('database.port') 40 PORT: config.get('database.port'),
41 USERNAME: config.get('database.username'),
42 PASSWORD: config.get('database.password')
41 }, 43 },
42 STORAGE: { 44 STORAGE: {
43 CERT_DIR: path.join(__dirname, '..', '..', config.get('storage.certs')), 45 CERT_DIR: path.join(__dirname, '..', '..', config.get('storage.certs')),
@@ -87,41 +89,7 @@ const FRIEND_SCORE = {
87 89
88// --------------------------------------------------------------------------- 90// ---------------------------------------------------------------------------
89 91
90const MIGRATION_SCRIPTS = [ 92const LAST_MIGRATION_VERSION = 0
91 {
92 script: '0005-create-application',
93 version: 5
94 },
95 {
96 script: '0010-users-password',
97 version: 10
98 },
99 {
100 script: '0015-admin-role',
101 version: 15
102 },
103 {
104 script: '0020-requests-endpoint',
105 version: 20
106 },
107 {
108 script: '0025-video-filenames',
109 version: 25
110 },
111 {
112 script: '0030-video-magnet',
113 version: 30
114 },
115 {
116 script: '0035-url-to-host',
117 version: 35
118 },
119 {
120 script: '0040-video-remote-id',
121 version: 40
122 }
123]
124const LAST_SQL_SCHEMA_VERSION = (maxBy(MIGRATION_SCRIPTS, 'version'))['version']
125 93
126// --------------------------------------------------------------------------- 94// ---------------------------------------------------------------------------
127 95
@@ -197,8 +165,7 @@ module.exports = {
197 CONFIG, 165 CONFIG,
198 CONSTRAINTS_FIELDS, 166 CONSTRAINTS_FIELDS,
199 FRIEND_SCORE, 167 FRIEND_SCORE,
200 LAST_SQL_SCHEMA_VERSION, 168 LAST_MIGRATION_VERSION,
201 MIGRATION_SCRIPTS,
202 OAUTH_LIFETIME, 169 OAUTH_LIFETIME,
203 PAGINATION_COUNT_DEFAULT, 170 PAGINATION_COUNT_DEFAULT,
204 PODS_SCORE, 171 PODS_SCORE,