Skip to content

Commit

Permalink
fix all migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrodes committed Jan 7, 2025
1 parent d80d207 commit 303ce01
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions db/migration/1736209759039-RemoveHousekeepingSuggestedReviews.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class RemoveHousekeepingSuggestedReviews1736209759039 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DROP TABLE IF EXISTS housekeeping_suggested_reviews`
)
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
public async down(_queryRunner: QueryRunner): Promise<void> {
return
}

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

export class CreateHousekeeper1736209905900 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
CREATE TABLE housekeeper_reviews (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT "Identifier of the review",
suggestedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Date where the review was suggested",
objectType VARCHAR(255) NOT NULL COMMENT "Type of the object to review (e.g. 'chart', 'dataset', etc.)",
objectId INTEGER NOT NULL COMMENT "ID of the object to review"
)
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE housekeeper_reviews`)
}

}

0 comments on commit 303ce01

Please sign in to comment.