Skip to content

Commit

Permalink
chore: Update "created_at" column in "table_actions" table to have a …
Browse files Browse the repository at this point in the history
…default timestamp
  • Loading branch information
Artuomka committed Jul 4, 2024
1 parent 0bba685 commit 3375583
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export class AddDefaultTimestampInTableActionEntity1719404444515 implements Migr
name = 'AddDefaultTimestampInTableActionEntity1719404444515';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`UPDATE "table_actions" SET "created_at" = now() WHERE "created_at" IS NULL`);
await queryRunner.query(`ALTER TABLE "table_actions" ALTER COLUMN "created_at" SET NOT NULL`);
await queryRunner.query(`ALTER TABLE "table_actions" ALTER COLUMN "created_at" SET DEFAULT now()`);
}
Expand Down

0 comments on commit 3375583

Please sign in to comment.