Skip to content

Commit

Permalink
Allow demo URL to be null (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele authored Jul 25, 2020
1 parent 6e2b2ce commit 4b29b41
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion entities/match.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Match extends BaseEntity {
/**
* URL to download the demo file
*/
@Column()
@Column({ nullable: true })
demoUrl: string;

/**
Expand Down
19 changes: 19 additions & 0 deletions migrations/1595714632487-allow-demoUrl-null.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class allowDemoUrlNull1595714632487 implements MigrationInterface {
name = "allowDemoUrlNull1595714632487";

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "match" ALTER COLUMN "demoUrl" DROP NOT NULL`,
undefined
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "match" ALTER COLUMN "demoUrl" SET NOT NULL`,
undefined
);
}
}

0 comments on commit 4b29b41

Please sign in to comment.