From 58f3abfd4d39ed9f65df3f45937030e75215913a Mon Sep 17 00:00:00 2001 From: FranGuam Date: Mon, 18 Mar 2024 15:48:57 +0800 Subject: [PATCH] fix(fkey): foreign key rule update for contest_team --- .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 migrations/1710748089715_set_fk_public_contest_team_contest_id/down.sql create mode 100644 migrations/1710748089715_set_fk_public_contest_team_contest_id/up.sql create mode 100644 migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/down.sql create mode 100644 migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/up.sql diff --git a/migrations/1710748089715_set_fk_public_contest_team_contest_id/down.sql b/migrations/1710748089715_set_fk_public_contest_team_contest_id/down.sql new file mode 100644 index 0000000..115f9c7 --- /dev/null +++ b/migrations/1710748089715_set_fk_public_contest_team_contest_id/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team" drop constraint "contest_team_contest_id_fkey", + add constraint "contest_team_contest_id_fkey" + foreign key ("contest_id") + references "public"."contest" + ("id") on update cascade on delete cascade; diff --git a/migrations/1710748089715_set_fk_public_contest_team_contest_id/up.sql b/migrations/1710748089715_set_fk_public_contest_team_contest_id/up.sql new file mode 100644 index 0000000..25482ba --- /dev/null +++ b/migrations/1710748089715_set_fk_public_contest_team_contest_id/up.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team" drop constraint "contest_team_contest_id_fkey", + add constraint "contest_team_contest_id_fkey" + foreign key ("contest_id") + references "public"."contest" + ("id") on update restrict on delete cascade; diff --git a/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/down.sql b/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/down.sql new file mode 100644 index 0000000..cff5028 --- /dev/null +++ b/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team" drop constraint "contest_team_team_leader_uuid_fkey", + add constraint "contest_team_team_leader_uuid_fkey" + foreign key ("team_leader_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/up.sql b/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/up.sql new file mode 100644 index 0000000..9595391 --- /dev/null +++ b/migrations/1710748106580_set_fk_public_contest_team_team_leader_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team" drop constraint "contest_team_team_leader_uuid_fkey", + add constraint "contest_team_team_leader_uuid_fkey" + foreign key ("team_leader_uuid") + references "public"."users" + ("uuid") on update restrict on delete cascade;