From 81aca59c5cb77c20c0c1dba513ece245f19a74c4 Mon Sep 17 00:00:00 2001 From: xiangmy21 <2248278431@qq.com> Date: Sun, 25 Feb 2024 16:58:13 +0800 Subject: [PATCH] fix(uuid): foreign key cascade --- .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ .../down.sql | 5 +++++ .../up.sql | 5 +++++ 24 files changed, 120 insertions(+) create mode 100644 migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/down.sql create mode 100644 migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/up.sql create mode 100644 migrations/1708850949259_set_fk_public_aid_application_student_uuid/down.sql create mode 100644 migrations/1708850949259_set_fk_public_aid_application_student_uuid/up.sql create mode 100644 migrations/1708850981893_set_fk_public_contest_manager_user_uuid/down.sql create mode 100644 migrations/1708850981893_set_fk_public_contest_manager_user_uuid/up.sql create mode 100644 migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/down.sql create mode 100644 migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/up.sql create mode 100644 migrations/1708851017720_set_fk_public_honor_application_student_uuid/down.sql create mode 100644 migrations/1708851017720_set_fk_public_honor_application_student_uuid/up.sql create mode 100644 migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/down.sql create mode 100644 migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/up.sql create mode 100644 migrations/1708851044990_set_fk_public_mentor_application_student_uuid/down.sql create mode 100644 migrations/1708851044990_set_fk_public_mentor_application_student_uuid/up.sql create mode 100644 migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/down.sql create mode 100644 migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/up.sql create mode 100644 migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/down.sql create mode 100644 migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/up.sql create mode 100644 migrations/1708851086379_set_fk_public_mentor_message_from_uuid/down.sql create mode 100644 migrations/1708851086379_set_fk_public_mentor_message_from_uuid/up.sql create mode 100644 migrations/1708851099672_set_fk_public_mentor_message_to_uuid/down.sql create mode 100644 migrations/1708851099672_set_fk_public_mentor_message_to_uuid/up.sql create mode 100644 migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/down.sql create mode 100644 migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/up.sql diff --git a/migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/down.sql b/migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/down.sql new file mode 100644 index 0000000..d29fc17 --- /dev/null +++ b/migrations/1708850924494_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 restrict on delete restrict; diff --git a/migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/up.sql b/migrations/1708850924494_set_fk_public_contest_team_team_leader_uuid/up.sql new file mode 100644 index 0000000..cff5028 --- /dev/null +++ b/migrations/1708850924494_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 cascade on delete cascade; diff --git a/migrations/1708850949259_set_fk_public_aid_application_student_uuid/down.sql b/migrations/1708850949259_set_fk_public_aid_application_student_uuid/down.sql new file mode 100644 index 0000000..cd11113 --- /dev/null +++ b/migrations/1708850949259_set_fk_public_aid_application_student_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."aid_application" drop constraint "aid_application_student_uuid_fkey", + add constraint "aid_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708850949259_set_fk_public_aid_application_student_uuid/up.sql b/migrations/1708850949259_set_fk_public_aid_application_student_uuid/up.sql new file mode 100644 index 0000000..f5eb9c3 --- /dev/null +++ b/migrations/1708850949259_set_fk_public_aid_application_student_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."aid_application" drop constraint "aid_application_student_uuid_fkey", + add constraint "aid_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/down.sql b/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/down.sql new file mode 100644 index 0000000..da4ecda --- /dev/null +++ b/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_manager" drop constraint "contest_manager_user_uuid_fkey", + add constraint "contest_manager_user_uuid_fkey" + foreign key ("user_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/up.sql b/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/up.sql new file mode 100644 index 0000000..80c2324 --- /dev/null +++ b/migrations/1708850981893_set_fk_public_contest_manager_user_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_manager" drop constraint "contest_manager_user_uuid_fkey", + add constraint "contest_manager_user_uuid_fkey" + foreign key ("user_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/down.sql b/migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/down.sql new file mode 100644 index 0000000..17b5d53 --- /dev/null +++ b/migrations/1708851010936_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 restrict on delete restrict; diff --git a/migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/up.sql b/migrations/1708851010936_set_fk_public_contest_team_member_user_uuid/up.sql new file mode 100644 index 0000000..80036a6 --- /dev/null +++ b/migrations/1708851010936_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 cascade on delete cascade; diff --git a/migrations/1708851017720_set_fk_public_honor_application_student_uuid/down.sql b/migrations/1708851017720_set_fk_public_honor_application_student_uuid/down.sql new file mode 100644 index 0000000..c2ab321 --- /dev/null +++ b/migrations/1708851017720_set_fk_public_honor_application_student_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."honor_application" drop constraint "honor_application_student_uuid_fkey", + add constraint "honor_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851017720_set_fk_public_honor_application_student_uuid/up.sql b/migrations/1708851017720_set_fk_public_honor_application_student_uuid/up.sql new file mode 100644 index 0000000..db857b4 --- /dev/null +++ b/migrations/1708851017720_set_fk_public_honor_application_student_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."honor_application" drop constraint "honor_application_student_uuid_fkey", + add constraint "honor_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/down.sql b/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/down.sql new file mode 100644 index 0000000..d6aa1da --- /dev/null +++ b/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_mentor_uuid_fkey", + add constraint "mentor_application_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/up.sql b/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/up.sql new file mode 100644 index 0000000..1e16bff --- /dev/null +++ b/migrations/1708851034569_set_fk_public_mentor_application_mentor_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_mentor_uuid_fkey", + add constraint "mentor_application_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/down.sql b/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/down.sql new file mode 100644 index 0000000..ccde268 --- /dev/null +++ b/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_student_uuid_fkey", + add constraint "mentor_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/up.sql b/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/up.sql new file mode 100644 index 0000000..f6ead09 --- /dev/null +++ b/migrations/1708851044990_set_fk_public_mentor_application_student_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_student_uuid_fkey", + add constraint "mentor_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/down.sql b/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/down.sql new file mode 100644 index 0000000..0d1dea1 --- /dev/null +++ b/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_available" drop constraint "mentor_available_mentor_uuid_fkey", + add constraint "mentor_available_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/up.sql b/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/up.sql new file mode 100644 index 0000000..7aa0bb7 --- /dev/null +++ b/migrations/1708851058094_set_fk_public_mentor_available_mentor_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_available" drop constraint "mentor_available_mentor_uuid_fkey", + add constraint "mentor_available_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/down.sql b/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/down.sql new file mode 100644 index 0000000..b8f01ba --- /dev/null +++ b/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_info" drop constraint "mentor_info_mentor_uuid_fkey", + add constraint "mentor_info_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/up.sql b/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/up.sql new file mode 100644 index 0000000..6bf8e06 --- /dev/null +++ b/migrations/1708851079099_set_fk_public_mentor_info_mentor_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_info" drop constraint "mentor_info_mentor_uuid_fkey", + add constraint "mentor_info_mentor_uuid_fkey" + foreign key ("mentor_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/down.sql b/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/down.sql new file mode 100644 index 0000000..32fa12a --- /dev/null +++ b/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_from_uuid_fkey", + add constraint "mentor_message_from_uuid_fkey" + foreign key ("from_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/up.sql b/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/up.sql new file mode 100644 index 0000000..3e16339 --- /dev/null +++ b/migrations/1708851086379_set_fk_public_mentor_message_from_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_from_uuid_fkey", + add constraint "mentor_message_from_uuid_fkey" + foreign key ("from_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/down.sql b/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/down.sql new file mode 100644 index 0000000..18879b1 --- /dev/null +++ b/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_to_uuid_fkey", + add constraint "mentor_message_to_uuid_fkey" + foreign key ("to_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/up.sql b/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/up.sql new file mode 100644 index 0000000..98a6cc9 --- /dev/null +++ b/migrations/1708851099672_set_fk_public_mentor_message_to_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_to_uuid_fkey", + add constraint "mentor_message_to_uuid_fkey" + foreign key ("to_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade; diff --git a/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/down.sql b/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/down.sql new file mode 100644 index 0000000..f09d681 --- /dev/null +++ b/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."scholarship_application" drop constraint "scholarship_application_student_uuid_fkey", + add constraint "scholarship_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update restrict on delete restrict; diff --git a/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/up.sql b/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/up.sql new file mode 100644 index 0000000..135ae81 --- /dev/null +++ b/migrations/1708851376397_set_fk_public_scholarship_application_student_uuid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."scholarship_application" drop constraint "scholarship_application_student_uuid_fkey", + add constraint "scholarship_application_student_uuid_fkey" + foreign key ("student_uuid") + references "public"."users" + ("uuid") on update cascade on delete cascade;