d23e6a1c97
* fix migrations to not use config constant values as it can introduce bugs later when they change; (fixes #1259) remove constant fields imports from migrations * add migrations to update description and support fields to 1000 (fixes #1258) * fix client/server account and video_channel description/support fields to be max len 1000 (fixes #1258); fix test Should fail with a too long description; fix test Should fail with a long description; fix test Should fail with a long description; Remove USER.SUPPORT from constants since that field no longer exists; null not false, in migrations/0280-description-support.ts; video support field 1000, oops; * rename migration 0280-description-support.ts -> 0285-description-support.ts; update video support maxlength text
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
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('video', 'support', data)
|
|
}
|
|
|
|
{
|
|
const data = {
|
|
type: Sequelize.STRING(1000),
|
|
allowNull: true,
|
|
defaultValue: null
|
|
}
|
|
await utils.queryInterface.changeColumn('videoChannel', 'support', data)
|
|
}
|
|
|
|
{
|
|
const data = {
|
|
type: Sequelize.STRING(1000),
|
|
allowNull: true,
|
|
defaultValue: null
|
|
}
|
|
await utils.queryInterface.changeColumn('videoChannel', 'description', data)
|
|
}
|
|
|
|
{
|
|
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
|
|
}
|