diff --git a/CommonServer/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts b/CommonServer/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts new file mode 100644 index 0000000000..9d91a5932c --- /dev/null +++ b/CommonServer/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class MigrationName1720024126646 implements MigrationInterface { + public name = "MigrationName1720024126646"; + + public async up(queryRunner: QueryRunner): Promise { + // change type of secretValue from varchar to text + await queryRunner.query( + `ALTER TABLE "MonitorSecret" ALTER COLUMN "secretValue" TYPE text`, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "MonitorSecret" ALTER COLUMN "secretValue" TYPE character varying(500)`, + ); + } +} diff --git a/CommonServer/Infrastructure/Postgres/SchemaMigrations/Index.ts b/CommonServer/Infrastructure/Postgres/SchemaMigrations/Index.ts index 4a20979156..b471474d3e 100644 --- a/CommonServer/Infrastructure/Postgres/SchemaMigrations/Index.ts +++ b/CommonServer/Infrastructure/Postgres/SchemaMigrations/Index.ts @@ -23,6 +23,7 @@ import { MigrationName1719827175832 } from "./1719827175832-MigrationName"; import { MigrationName1719831213463 } from "./1719831213463-MigrationName"; import { MigrationName1719838746775 } from "./1719838746775-MigrationName"; import { MigrationName1719915433542 } from "./1719915433542-MigrationName"; +import { MigrationName1720024126646 } from "./1720024126646-MigrationName"; export default [ InitialMigration, @@ -50,4 +51,5 @@ export default [ MigrationName1719831213463, MigrationName1719838746775, MigrationName1719915433542, + MigrationName1720024126646, ]; diff --git a/Model/Models/MonitorSecret.ts b/Model/Models/MonitorSecret.ts index 8beba3b0d9..c7f3db4fea 100644 --- a/Model/Models/MonitorSecret.ts +++ b/Model/Models/MonitorSecret.ts @@ -227,7 +227,7 @@ export default class MonitorSecret extends BaseModel { }) @TableColumn({ required: false, - type: TableColumnType.LongText, + type: TableColumnType.VeryLongText, encrypted: true, title: "Secret Value", description: @@ -235,8 +235,7 @@ export default class MonitorSecret extends BaseModel { }) @Column({ nullable: true, - type: ColumnType.LongText, - length: ColumnLength.LongText, + type: ColumnType.VeryLongText, }) public secretValue?: string = undefined;