Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Marigold committed Sep 16, 2024
1 parent 116203d commit a813b4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
11 changes: 0 additions & 11 deletions db/migration/1726480222200-AlignUpdatedAtOfCharts.ts

This file was deleted.

18 changes: 18 additions & 0 deletions db/migration/1726480222201-AlignUpdatedAtOfCharts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class AlignUpdatedAtOfCharts1726480222201 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
UPDATE chart_configs cf
INNER JOIN charts c ON c.configId = cf.id
SET cf.updatedAt = LEAST(cf.updatedAt, c.updatedAt)
WHERE c.updatedAt IS NOT NULL;
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {

Check warning on line 13 in db/migration/1726480222201-AlignUpdatedAtOfCharts.ts

View workflow job for this annotation

GitHub Actions / eslint

'queryRunner' is defined but never used. Allowed unused args must match /^_/u

Check warning on line 13 in db/migration/1726480222201-AlignUpdatedAtOfCharts.ts

View workflow job for this annotation

GitHub Actions / eslint

'queryRunner' is defined but never used. Allowed unused args must match /^_/u
throw new Error(
"Cannot automatically revert migration 'AlignUpdatedAtOfCharts1726480222201'"
)
}
}

0 comments on commit a813b4a

Please sign in to comment.