From 25c3ee955963fad30faf6623643e9146b5249a9f Mon Sep 17 00:00:00 2001 From: Jingyi Gao Date: Tue, 24 Oct 2023 13:30:36 +1100 Subject: [PATCH] use on delete no action --- .../20231024020758_RemoveDeleteCascadeOnParticipantTypes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/migrations/20231024020758_RemoveDeleteCascadeOnParticipantTypes.ts b/src/database/migrations/20231024020758_RemoveDeleteCascadeOnParticipantTypes.ts index be8a20e5d..a87dae088 100644 --- a/src/database/migrations/20231024020758_RemoveDeleteCascadeOnParticipantTypes.ts +++ b/src/database/migrations/20231024020758_RemoveDeleteCascadeOnParticipantTypes.ts @@ -3,12 +3,12 @@ import { Knex } from 'knex'; export async function up(knex: Knex): Promise { await knex.schema.alterTable('participantsToTypes', (table) => { table.dropForeign('participantTypeId'); - table.foreign('participantTypeId').references('participantTypes.id'); + table.foreign('participantTypeId').references('participantTypes.id').onDelete('NO ACTION'); }); await knex.schema.alterTable('approvers', (table) => { table.dropForeign('participantTypeId'); - table.foreign('participantTypeId').references('participantTypes.id'); + table.foreign('participantTypeId').references('participantTypes.id').onDelete('NO ACTION'); }); }