// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 460
+const LAST_MIGRATION_VERSION = 465
// ---------------------------------------------------------------------------
PLUGINS: {
NAME: { min: 1, max: 214 }, // Length
DESCRIPTION: { min: 1, max: 20000 } // Length
+ },
+ COMMONS: {
+ URL: { min: 5, max: 2000 } // Length
}
}
--- /dev/null
+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(2000),
+ allowNull: true,
+ defaultValue: null
+ }
+
+ await utils.queryInterface.changeColumn('thumbnail', 'fileUrl', data)
+ }
+}
+
+function down (options) {
+ throw new Error('Not implemented.')
+}
+
+export {
+ up,
+ down
+}
import { join } from 'path'
-import { AfterDestroy, AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'
-import { LAZY_STATIC_PATHS, STATIC_PATHS, WEBSERVER } from '../../initializers/constants'
+import {
+ AfterDestroy,
+ AllowNull,
+ BelongsTo,
+ Column,
+ CreatedAt,
+ DataType,
+ Default,
+ ForeignKey,
+ Model,
+ Table,
+ UpdatedAt
+} from 'sequelize-typescript'
+import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, STATIC_PATHS, WEBSERVER } from '../../initializers/constants'
import { logger } from '../../helpers/logger'
import { remove } from 'fs-extra'
import { CONFIG } from '../../initializers/config'
type: ThumbnailType
@AllowNull(true)
- @Column
+ @Column(DataType.STRING(CONSTRAINTS_FIELDS.COMMONS.URL.max))
fileUrl: string
@AllowNull(true)