aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-09 13:32:44 +0200
committerChocobozzz <me@florianbigard.com>2018-05-09 13:32:44 +0200
commita10fc78bb0e00e98c8f59edc16cd323b9c8b0615 (patch)
tree4988ea8836d47321061c7f8c8a78ebd2b4eb35ef /server/models
parent360329cc029c062bfb145c90f7bf1c007c39af81 (diff)
downloadPeerTube-a10fc78bb0e00e98c8f59edc16cd323b9c8b0615.tar.gz
PeerTube-a10fc78bb0e00e98c8f59edc16cd323b9c8b0615.tar.zst
PeerTube-a10fc78bb0e00e98c8f59edc16cd323b9c8b0615.zip
Fix video channel description/support max length
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video-channel.ts7
1 files changed, 4 insertions, 3 deletions
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 @@
1import { 1import {
2 AllowNull, BeforeDestroy, BelongsTo, Column, CreatedAt, DefaultScope, ForeignKey, HasMany, Is, Model, Scopes, Table, 2 AllowNull, BeforeDestroy, BelongsTo, Column, CreatedAt, DefaultScope, ForeignKey, HasMany, Is, Model, Scopes, Table,
3 UpdatedAt, Default 3 UpdatedAt, Default, DataType
4} from 'sequelize-typescript' 4} from 'sequelize-typescript'
5import { ActivityPubActor } from '../../../shared/models/activitypub' 5import { ActivityPubActor } from '../../../shared/models/activitypub'
6import { VideoChannel } from '../../../shared/models/videos' 6import { VideoChannel } from '../../../shared/models/videos'
@@ -14,6 +14,7 @@ import { AccountModel } from '../account/account'
14import { ActorModel } from '../activitypub/actor' 14import { ActorModel } from '../activitypub/actor'
15import { getSort, throwIfNotValid } from '../utils' 15import { getSort, throwIfNotValid } from '../utils'
16import { VideoModel } from './video' 16import { VideoModel } from './video'
17import { CONSTRAINTS_FIELDS } from '../../initializers'
17 18
18enum ScopeNames { 19enum ScopeNames {
19 WITH_ACCOUNT = 'WITH_ACCOUNT', 20 WITH_ACCOUNT = 'WITH_ACCOUNT',
@@ -73,13 +74,13 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
73 @AllowNull(true) 74 @AllowNull(true)
74 @Default(null) 75 @Default(null)
75 @Is('VideoChannelDescription', value => throwIfNotValid(value, isVideoChannelDescriptionValid, 'description')) 76 @Is('VideoChannelDescription', value => throwIfNotValid(value, isVideoChannelDescriptionValid, 'description'))
76 @Column 77 @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_CHANNELS.DESCRIPTION.max))
77 description: string 78 description: string
78 79
79 @AllowNull(true) 80 @AllowNull(true)
80 @Default(null) 81 @Default(null)
81 @Is('VideoChannelSupport', value => throwIfNotValid(value, isVideoChannelSupportValid, 'support')) 82 @Is('VideoChannelSupport', value => throwIfNotValid(value, isVideoChannelSupportValid, 'support'))
82 @Column 83 @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEO_CHANNELS.SUPPORT.max))
83 support: string 84 support: string
84 85
85 @CreatedAt 86 @CreatedAt