fix: Remove region_id from countries on region deletes (#1330)

* Remove region id from countries on delete

* Update snapshots
This commit is contained in:
Oliver Windall Juhl
2022-04-13 10:52:25 +02:00
committed by GitHub
parent 2a1b34c20f
commit edc6d9d29c
5 changed files with 222 additions and 41 deletions
+5 -9
View File
@@ -1,12 +1,11 @@
import {
Entity,
Column,
ManyToOne,
JoinColumn,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from "typeorm"
import { Region } from "./region"
@Entity()
@@ -32,12 +31,9 @@ export class Country {
@Index()
@Column({ nullable: true })
region_id: string
region_id: string | null
@ManyToOne(
() => Region,
r => r.countries
)
@ManyToOne(() => Region, (r) => r.countries)
@JoinColumn({ name: "region_id" })
region: Region
}