From a10fc78bb0e00e98c8f59edc16cd323b9c8b0615 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 May 2018 13:32:44 +0200 Subject: Fix video channel description/support max length --- server/models/video/video-channel.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index 4a50af265..8498143fe 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -1,6 +1,6 @@ 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' @@ -14,6 +14,7 @@ import { AccountModel } from '../account/account' 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', @@ -73,13 +74,13 @@ export class VideoChannelModel extends Model { @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 -- cgit v1.2.3