Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Commit b48ac0e

Browse files
committed
feat: change episode to allow null images
1 parent 40e727b commit b48ac0e

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

packages/server/src/db/dto/episode.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class EpisodeDto {
1717
@Field()
1818
url: string;
1919

20-
@Field()
20+
@Field({ nullable: true })
2121
image: string;
2222

2323
@Field()

packages/server/src/db/entities/episode.entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class EpisodeEntity {
1515
@Column()
1616
url: string;
1717

18-
@Column()
18+
@Column({ nullable: true })
1919
image: string;
2020

2121
@Column()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
2+
3+
export class ChangeEpisodeImageToAllowNull1589228321950
4+
implements MigrationInterface {
5+
name = 'ChangeEpisodeImageToAllowNull1589228321950';
6+
7+
public async up(queryRunner: QueryRunner): Promise<void> {
8+
await queryRunner.query(
9+
`ALTER TABLE "episode" ALTER COLUMN "image" DROP NOT NULL`,
10+
undefined,
11+
);
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
await queryRunner.query(
16+
`ALTER TABLE "episode" ALTER COLUMN "image" SET NOT NULL`,
17+
undefined,
18+
);
19+
}
20+
}

0 commit comments

Comments
 (0)