Skip to content

Commit

Permalink
chore: updated SQLite migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Feb 18, 2025
1 parent 8e30ebc commit 2dd9df8
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ export class UpdateStatusList1737110469000 implements MigrationInterface {
name = 'UpdateStatusList1737110469000'

public async up(queryRunner: QueryRunner): Promise<void> {
// Fix correlationId fields
await queryRunner.query(`
ALTER TABLE "StatusListEntry"
ADD COLUMN "statusListCorrelationId" varchar(255)
`)

await queryRunner.query(`
ALTER TABLE "StatusListEntry"
RENAME COLUMN "correlationId" TO "entryCorrelationId"
`)

// Create temporary table with new schema
await queryRunner.query(
`CREATE TABLE "temporary_StatusList" (
Expand Down Expand Up @@ -44,6 +55,16 @@ export class UpdateStatusList1737110469000 implements MigrationInterface {
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "StatusListEntry"
RENAME COLUMN "entryCorrelationId" TO "correlationId"
`)

await queryRunner.query(`
ALTER TABLE "StatusListEntry"
DROP COLUMN "statusListCorrelationId"
`)

// Create temporary table with old schema
await queryRunner.query(
`CREATE TABLE "temporary_StatusList" (
Expand Down

0 comments on commit 2dd9df8

Please sign in to comment.