aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts3
-rw-r--r--server/initializers/migrations/0245-user-blocked.ts14
2 files changed, 12 insertions, 5 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 0a651beed..ea561b686 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -254,7 +254,8 @@ const CONSTRAINTS_FIELDS = {
254 DESCRIPTION: { min: 3, max: 250 }, // Length 254 DESCRIPTION: { min: 3, max: 250 }, // Length
255 USERNAME: { min: 3, max: 20 }, // Length 255 USERNAME: { min: 3, max: 20 }, // Length
256 PASSWORD: { min: 6, max: 255 }, // Length 256 PASSWORD: { min: 6, max: 255 }, // Length
257 VIDEO_QUOTA: { min: -1 } 257 VIDEO_QUOTA: { min: -1 },
258 BLOCKED_REASON: { min: 3, max: 250 } // Length
258 }, 259 },
259 VIDEO_ABUSES: { 260 VIDEO_ABUSES: {
260 REASON: { min: 2, max: 300 } // Length 261 REASON: { min: 2, max: 300 } // Length
diff --git a/server/initializers/migrations/0245-user-blocked.ts b/server/initializers/migrations/0245-user-blocked.ts
index 67afea5ed..5a04ecd2b 100644
--- a/server/initializers/migrations/0245-user-blocked.ts
+++ b/server/initializers/migrations/0245-user-blocked.ts
@@ -1,8 +1,5 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { createClient } from 'redis' 2import { CONSTRAINTS_FIELDS } from '../constants'
3import { CONFIG } from '../constants'
4import { JobQueue } from '../../lib/job-queue'
5import { initDatabaseModels } from '../database'
6 3
7async function up (utils: { 4async function up (utils: {
8 transaction: Sequelize.Transaction 5 transaction: Sequelize.Transaction
@@ -31,6 +28,15 @@ async function up (utils: {
31 } 28 }
32 await utils.queryInterface.changeColumn('user', 'blocked', data) 29 await utils.queryInterface.changeColumn('user', 'blocked', data)
33 } 30 }
31
32 {
33 const data = {
34 type: Sequelize.STRING(CONSTRAINTS_FIELDS.USERS.BLOCKED_REASON.max),
35 allowNull: true,
36 defaultValue: null
37 }
38 await utils.queryInterface.addColumn('user', 'blockedReason', data)
39 }
34} 40}
35 41
36function down (options) { 42function down (options) {