Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
horpeazy committed May 10, 2024
1 parent 6e73e40 commit c870873
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import type { MigrationContext, ReversibleMigration } from '@db/types';
export class addConstarinToSvaeRequestLog1694091729096 implements ReversibleMigration {
name = 'addConstarinToSvaeRequestLog1694091729096';

public async up({ queryRunner, tablePrefix }: MigrationContext): Promise<void> {
public async up({ queryRunner, tablePrefix }: MigrationContext): Promise<void> {
await queryRunner.query(
`
ALTER TABLE ${tablePrefix}save_request_log ALTER COLUMN id TYPE VARCHAR(36)
`,
);
await queryRunner.query(
`
ALTER TABLE ${tablePrefix}save_request_log ADD CONSTRAINT "FK_9a3caef176a6bd386c9ca3b3799" FOREIGN KEY ("workflowId") REFERENCES "workflow_entity"("id") ON DELETE NO ACTION ON UPDATE NO action
Expand All @@ -15,5 +20,10 @@ export class addConstarinToSvaeRequestLog1694091729096 implements ReversibleMigr
await queryRunner.query(
`ALTER TABLE ${tablePrefix}save_request_log DROP CONSTRAINT IF EXISTS "FK_9a3caef176a6bd386c9ca3b3799";`,
);
await queryRunner.query(
`
ALTER TABLE ${tablePrefix}save_request_log ALTER COLUMN id TYPE integer
`,
);
}
}

0 comments on commit c870873

Please sign in to comment.