export const VIDEO_CHANNEL_DESCRIPTION = {
VALIDATORS: [
Validators.minLength(3),
- Validators.maxLength(250)
+ Validators.maxLength(500)
],
MESSAGES: {
'minlength': 'Description must be at least 3 characters long.',
- 'maxlength': 'Description cannot be more than 250 characters long.'
+ 'maxlength': 'Description cannot be more than 500 characters long.'
}
}
export const VIDEO_CHANNEL_SUPPORT = {
VALIDATORS: [
Validators.minLength(3),
- Validators.maxLength(300)
+ Validators.maxLength(500)
],
MESSAGES: {
'minlength': 'Support text must be at least 3 characters long.',
- 'maxlength': 'Support text cannot be more than 300 characters long.'
+ 'maxlength': 'Support text cannot be more than 500 characters long.'
}
}
}
export const VIDEO_SUPPORT = {
- VALIDATORS: [ Validators.minLength(3), Validators.maxLength(300) ],
+ VALIDATORS: [ Validators.minLength(3), Validators.maxLength(500) ],
MESSAGES: {
'minlength': 'Video support must be at least 3 characters long.',
- 'maxlength': 'Video support cannot be more than 300 characters long.'
+ 'maxlength': 'Video support cannot be more than 500 characters long.'
}
}
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 210
+const LAST_MIGRATION_VERSION = 215
// ---------------------------------------------------------------------------
},
VIDEO_CHANNELS: {
NAME: { min: 3, max: 120 }, // Length
- DESCRIPTION: { min: 3, max: 250 }, // Length
- SUPPORT: { min: 3, max: 300 }, // Length
+ DESCRIPTION: { min: 3, max: 500 }, // Length
+ SUPPORT: { min: 3, max: 500 }, // Length
URL: { min: 3, max: 2000 } // Length
},
VIDEOS: {
LANGUAGE: { min: 1, max: 10 }, // Length
TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length
DESCRIPTION: { min: 3, max: 10000 }, // Length
- SUPPORT: { min: 3, max: 300 }, // Length
+ SUPPORT: { min: 3, max: 500 }, // Length
IMAGE: {
EXTNAME: [ '.jpg', '.jpeg' ],
FILE_SIZE: {
--- /dev/null
+import * as Sequelize from 'sequelize'
+import { CONSTRAINTS_FIELDS } from '../index'
+
+async function up (utils: {
+ transaction: Sequelize.Transaction,
+ queryInterface: Sequelize.QueryInterface,
+ sequelize: Sequelize.Sequelize
+}): Promise<void> {
+ {
+ const data = {
+ type: Sequelize.STRING(500),
+ allowNull: true,
+ defaultValue: null
+ }
+ await utils.queryInterface.changeColumn('video', 'support', data)
+ }
+
+ {
+ const data = {
+ type: Sequelize.STRING(500),
+ allowNull: true,
+ defaultValue: null
+ }
+ await utils.queryInterface.changeColumn('videoChannel', 'support', data)
+ }
+
+ {
+ const data = {
+ type: Sequelize.STRING(500),
+ allowNull: true,
+ defaultValue: null
+ }
+ await utils.queryInterface.changeColumn('videoChannel', 'description', data)
+ }
+}
+
+function down (options) {
+ throw new Error('Not implemented.')
+}
+
+export {
+ up,
+ down
+}
import {
AllowNull, BeforeDestroy, BelongsTo, Column, CreatedAt, DefaultScope, ForeignKey, HasMany, Is, Model, Scopes, Table,
- UpdatedAt, Default
+ UpdatedAt, Default, DataType
} from 'sequelize-typescript'
import { ActivityPubActor } from '../../../shared/models/activitypub'
import { VideoChannel } from '../../../shared/models/videos'
import { ActorModel } from '../activitypub/actor'
import { getSort, throwIfNotValid } from '../utils'
import { VideoModel } from './video'
+import { CONSTRAINTS_FIELDS } from '../../initializers'
enum ScopeNames {
WITH_ACCOUNT = 'WITH_ACCOUNT',
@AllowNull(true)
@Default(null)
@Is('VideoChannelDescription', value => throwIfNotValid(value, isVideoChannelDescriptionValid, 'description'))
- @Column
+ @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_CHANNELS.DESCRIPTION.max))
description: string
@AllowNull(true)
@Default(null)
@Is('VideoChannelSupport', value => throwIfNotValid(value, isVideoChannelSupportValid, 'support'))
- @Column
+ @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_CHANNELS.SUPPORT.max))
support: string
@CreatedAt