From 210da5dc9c90d01101864ec777fc796c317ae45e Mon Sep 17 00:00:00 2001 From: Ronen Lubin Date: Mon, 18 Sep 2023 10:52:32 +0300 Subject: [PATCH] add on delete constraint to schema --- ts/testdata/models/Email.ts | 4 +++- ts/testdata/models/Phone.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/testdata/models/Email.ts b/ts/testdata/models/Email.ts index c5d76f9..47f17b3 100644 --- a/ts/testdata/models/Email.ts +++ b/ts/testdata/models/Email.ts @@ -54,7 +54,9 @@ class Email extends Model { @Column(DataType.INTEGER) contact_id!: number; - @BelongsTo(() => Contact) + @BelongsTo(() => Contact, { + onDelete: "CASCADE", + }) contact!: Contact; @CreatedAt diff --git a/ts/testdata/models/Phone.ts b/ts/testdata/models/Phone.ts index 22558c3..ed8845c 100644 --- a/ts/testdata/models/Phone.ts +++ b/ts/testdata/models/Phone.ts @@ -39,7 +39,9 @@ class Phone extends Model { @Column(DataType.INTEGER) contact_id!: number; - @BelongsTo(() => Contact) + @BelongsTo(() => Contact, { + onDelete: "CASCADE", + }) contact!: Contact; @CreatedAt