From 20a57d31e20632eec616ad2e6ed3e224f5ecb505 Mon Sep 17 00:00:00 2001 From: FranGuam Date: Mon, 18 Mar 2024 16:01:09 +0800 Subject: [PATCH] fix(fkey): foreign key rule update for contest_team_member --- .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 migrations/1710748785469_set_fk_public_contest_team_member_team_id/down.sql create mode 100644 migrations/1710748785469_set_fk_public_contest_team_member_team_id/up.sql create mode 100644 migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/down.sql create mode 100644 migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/up.sql diff --git a/migrations/1710748785469_set_fk_public_contest_team_member_team_id/down.sql b/migrations/1710748785469_set_fk_public_contest_team_member_team_id/down.sql new file mode 100644 index 0000000..924087f --- /dev/null +++ b/migrations/1710748785469_set_fk_public_contest_team_member_team_id/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_team_id_fkey", + add constraint "contest_team_member_team_id_fkey" + foreign key ("team_id") + references "public"."contest_team" + ("team_id") on update cascade on delete cascade; diff --git a/migrations/1710748785469_set_fk_public_contest_team_member_team_id/up.sql b/migrations/1710748785469_set_fk_public_contest_team_member_team_id/up.sql new file mode 100644 index 0000000..0b1eb35 --- /dev/null +++ b/migrations/1710748785469_set_fk_public_contest_team_member_team_id/up.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_team_id_fkey", + add constraint "contest_team_member_team_id_fkey" + foreign key ("team_id") + references "public"."contest_team" + ("team_id") on update restrict on delete cascade; diff --git a/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/down.sql b/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/down.sql new file mode 100644 index 0000000..80036a6 --- /dev/null +++ b/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_user_uuid_fkey", + add constraint "contest_team_member_user_uuid_fkey" + foreign key ("user_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/up.sql b/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/up.sql new file mode 100644 index 0000000..1f5f9f3 --- /dev/null +++ b/migrations/1710748811122_set_fk_public_contest_team_member_user_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_user_uuid_fkey", + add constraint "contest_team_member_user_uuid_fkey" + foreign key ("user_uuid") + references "public"."users" + ("uuid") on update restrict on delete cascade;