1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Feature/description support fields length 1000 (#1267)

* fix migrations to not use config constant values as it can introduce bugs later when they change; (fixes #1259)
remove constant fields imports from migrations

* add migrations to update description and support fields to 1000 (fixes #1258)

* fix client/server account and video_channel description/support fields to be max len 1000 (fixes #1258);
fix test Should fail with a too long description;
fix test Should fail with a long description;
fix test Should fail with a long description;
Remove USER.SUPPORT from constants since that field no longer exists;
null not false, in migrations/0280-description-support.ts;
video support field 1000, oops;

* rename migration 0280-description-support.ts -> 0285-description-support.ts;
update video support maxlength text
This commit is contained in:
BRAINS YUM 2018-10-19 01:54:01 -05:00 committed by Chocobozzz
parent e0628695c3
commit d23e6a1c97
15 changed files with 82 additions and 35 deletions

View file

@ -16,7 +16,7 @@ let config: IConfig = require('config')
// ---------------------------------------------------------------------------
const LAST_MIGRATION_VERSION = 280
const LAST_MIGRATION_VERSION = 285
// ---------------------------------------------------------------------------
@ -295,7 +295,7 @@ const CONFIG = {
const CONSTRAINTS_FIELDS = {
USERS: {
NAME: { min: 3, max: 120 }, // Length
DESCRIPTION: { min: 3, max: 250 }, // Length
DESCRIPTION: { min: 3, max: 1000 }, // Length
USERNAME: { min: 3, max: 20 }, // Length
PASSWORD: { min: 6, max: 255 }, // Length
VIDEO_QUOTA: { min: -1 },
@ -311,8 +311,8 @@ const CONSTRAINTS_FIELDS = {
},
VIDEO_CHANNELS: {
NAME: { min: 3, max: 120 }, // Length
DESCRIPTION: { min: 3, max: 500 }, // Length
SUPPORT: { min: 3, max: 500 }, // Length
DESCRIPTION: { min: 3, max: 1000 }, // Length
SUPPORT: { min: 3, max: 1000 }, // Length
URL: { min: 3, max: 2000 } // Length
},
VIDEO_CAPTIONS: {
@ -341,7 +341,7 @@ const CONSTRAINTS_FIELDS = {
LANGUAGE: { min: 1, max: 10 }, // Length
TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length
DESCRIPTION: { min: 3, max: 10000 }, // Length
SUPPORT: { min: 3, max: 500 }, // Length
SUPPORT: { min: 3, max: 1000 }, // Length
IMAGE: {
EXTNAME: [ '.jpg', '.jpeg' ],
FILE_SIZE: {