1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 08:18:45 +09:00
cherrypick/packages/backend/migration/1654589815249-increase-smtp-char-limit.js
Ryu jongheon 1b3fb2ae55
Fix SmtpCharLimit migration on downgrade may fail
smtpHost/smtpUser/smtpPass 가 128보다 긴 상황에서 다운그레이드할 때, 마이그레이션이 실패하거나 설정이 깨질 위험이 있기 때문에 아예 터치하지 않는 걸로
2022-06-08 09:12:22 +09:00

18 lines
900 B
JavaScript

export class increaseSmtpCharLimit1654589815249 {
name = 'increaseSmtpCharLimit1654589815249'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpHost" TYPE character varying(256)`);
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpUser" TYPE character varying(256)`);
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpPass" TYPE character varying(256)`);
}
async down(queryRunner) {
// It's safe to keep extended character limit, rather than shrinking with risk of breaking settings
// await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpHost" TYPE character varying(128)`);
// await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpUser" TYPE character varying(128)`);
// await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "smtpPass" TYPE character varying(128)`);
}
}