Fix account description error
This commit is contained in:
parent
b59f12b095
commit
241c3357d1
|
@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const LAST_MIGRATION_VERSION = 370
|
const LAST_MIGRATION_VERSION = 375
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
import * as Sequelize from 'sequelize'
|
||||||
|
|
||||||
|
async function up (utils: {
|
||||||
|
transaction: Sequelize.Transaction,
|
||||||
|
queryInterface: Sequelize.QueryInterface,
|
||||||
|
sequelize: Sequelize.Sequelize,
|
||||||
|
db: any
|
||||||
|
}): Promise<void> {
|
||||||
|
const data = {
|
||||||
|
type: Sequelize.STRING(1000),
|
||||||
|
allowNull: true,
|
||||||
|
defaultValue: null
|
||||||
|
}
|
||||||
|
|
||||||
|
await utils.queryInterface.changeColumn('account', 'description', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
function down (options) {
|
||||||
|
throw new Error('Not implemented.')
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
up,
|
||||||
|
down
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ import {
|
||||||
BeforeDestroy,
|
BeforeDestroy,
|
||||||
BelongsTo,
|
BelongsTo,
|
||||||
Column,
|
Column,
|
||||||
CreatedAt,
|
CreatedAt, DataType,
|
||||||
Default,
|
Default,
|
||||||
DefaultScope,
|
DefaultScope,
|
||||||
ForeignKey,
|
ForeignKey,
|
||||||
|
@ -26,7 +26,7 @@ import { VideoCommentModel } from '../video/video-comment'
|
||||||
import { UserModel } from './user'
|
import { UserModel } from './user'
|
||||||
import { AvatarModel } from '../avatar/avatar'
|
import { AvatarModel } from '../avatar/avatar'
|
||||||
import { VideoPlaylistModel } from '../video/video-playlist'
|
import { VideoPlaylistModel } from '../video/video-playlist'
|
||||||
import { WEBSERVER } from '../../initializers/constants'
|
import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers/constants'
|
||||||
import { Op, Transaction, WhereOptions } from 'sequelize'
|
import { Op, Transaction, WhereOptions } from 'sequelize'
|
||||||
|
|
||||||
export enum ScopeNames {
|
export enum ScopeNames {
|
||||||
|
@ -91,7 +91,7 @@ export class AccountModel extends Model<AccountModel> {
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Default(null)
|
@Default(null)
|
||||||
@Is('AccountDescription', value => throwIfNotValid(value, isAccountDescriptionValid, 'description', true))
|
@Is('AccountDescription', value => throwIfNotValid(value, isAccountDescriptionValid, 'description', true))
|
||||||
@Column
|
@Column(DataType.STRING(CONSTRAINTS_FIELDS.USERS.DESCRIPTION.max))
|
||||||
description: string
|
description: string
|
||||||
|
|
||||||
@CreatedAt
|
@CreatedAt
|
||||||
|
|
Loading…
Reference in New Issue