From 5a04d20a0e6956d47039632ddfe6054432aef914 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 25 Jun 2024 19:06:32 +0200 Subject: [PATCH 1/2] wip: chart diff conflicts --- .../1719334981843-chart-diff-conflicts.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/migration/1719334981843-chart-diff-conflicts.ts diff --git a/db/migration/1719334981843-chart-diff-conflicts.ts b/db/migration/1719334981843-chart-diff-conflicts.ts new file mode 100644 index 00000000000..13b7c1ebc59 --- /dev/null +++ b/db/migration/1719334981843-chart-diff-conflicts.ts @@ -0,0 +1,21 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class ChartDiffConflicts1719334981843 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + CREATE TABLE chart_diff_conflicts ( + id integer NOT NULL AUTO_INCREMENT, + chartId integer NOT NULL, + targetUpdatedAt datetime DEFAULT NULL, + conflict varchar(255) NOT NULL, + FOREIGN KEY (chartId) REFERENCES charts (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + INDEX (chartId) + ) + `) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE chart_diff_conflicts`) + } +} From f1257a8d8ded4c96e6ce05bf4a2e8b51add326de Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 25 Jun 2024 20:11:49 +0200 Subject: [PATCH 2/2] modify migration --- ...-conflicts.ts => 1719338980266-AddChartDiffConflictsTable.ts} | 1 + 1 file changed, 1 insertion(+) rename db/migration/{1719334981843-chart-diff-conflicts.ts => 1719338980266-AddChartDiffConflictsTable.ts} (94%) diff --git a/db/migration/1719334981843-chart-diff-conflicts.ts b/db/migration/1719338980266-AddChartDiffConflictsTable.ts similarity index 94% rename from db/migration/1719334981843-chart-diff-conflicts.ts rename to db/migration/1719338980266-AddChartDiffConflictsTable.ts index 13b7c1ebc59..6d490db9e7a 100644 --- a/db/migration/1719334981843-chart-diff-conflicts.ts +++ b/db/migration/1719338980266-AddChartDiffConflictsTable.ts @@ -7,6 +7,7 @@ export class ChartDiffConflicts1719334981843 implements MigrationInterface { id integer NOT NULL AUTO_INCREMENT, chartId integer NOT NULL, targetUpdatedAt datetime DEFAULT NULL, + updatedAt datetime NOT NULL, conflict varchar(255) NOT NULL, FOREIGN KEY (chartId) REFERENCES charts (id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id),