diff --git a/metadata/actions.graphql b/metadata/actions.graphql index 02fbb3a..e69de29 100644 --- a/metadata/actions.graphql +++ b/metadata/actions.graphql @@ -1,18 +0,0 @@ -type Query { - user_by_role( - role: String! - ): [user_by_role_user!]! -} - -type user_by_role_user { - _id: String! - name: String! - department: String! -} - -type user_by_role_users { - uuid: uuid! - realname: String! - department: String! -} - diff --git a/metadata/actions.yaml b/metadata/actions.yaml index d077760..1edb4c2 100644 --- a/metadata/actions.yaml +++ b/metadata/actions.yaml @@ -1,30 +1,6 @@ -actions: - - name: user_by_role - definition: - kind: "" - handler: https://api.eesast.com/user/user_by_role - forward_client_headers: true - headers: - - name: x-hasura-action-secret - value_from_env: ACTION_SECRET - permissions: - - role: teacher - - role: root - - role: counselor - - role: student +actions: [] custom_types: enums: [] input_objects: [] - objects: - - name: user_by_role_user - relationships: - - field_mapping: - _id: _id - name: user - remote_table: - name: user - schema: public - source: default - type: object - - name: user_by_role_users + objects: [] scalars: [] diff --git a/metadata/tables.yaml b/metadata/tables.yaml index 5026ba3..926d81b 100644 --- a/metadata/tables.yaml +++ b/metadata/tables.yaml @@ -2,9 +2,6 @@ name: aid_application schema: public object_relationships: - - name: student - using: - foreign_key_constraint_on: student_id - name: user using: foreign_key_constraint_on: student_uuid @@ -539,9 +536,6 @@ - name: contest using: foreign_key_constraint_on: contest_id - - name: user - using: - foreign_key_constraint_on: user_id - name: userByUserUuid using: foreign_key_constraint_on: user_uuid @@ -725,9 +719,6 @@ - name: team_leader_byuuid using: foreign_key_constraint_on: team_leader_uuid - - name: team_leader_id - using: - foreign_key_constraint_on: team_leader array_relationships: - name: contest_team_members using: @@ -967,9 +958,6 @@ - name: user using: foreign_key_constraint_on: user_uuid - - name: user_as_contest_team_member - using: - foreign_key_constraint_on: user_id insert_permissions: - role: counselor permission: @@ -1056,10 +1044,7 @@ name: honor_application schema: public object_relationships: - - name: student - using: - foreign_key_constraint_on: student_id - - name: user + - name: student_byuuid using: foreign_key_constraint_on: student_uuid insert_permissions: @@ -1372,15 +1357,9 @@ name: mentor_application schema: public object_relationships: - - name: mentor - using: - foreign_key_constraint_on: mentor_id - name: mentor_byuuid using: foreign_key_constraint_on: mentor_uuid - - name: student - using: - foreign_key_constraint_on: student_id - name: student_byuuid using: foreign_key_constraint_on: student_uuid @@ -1651,9 +1630,6 @@ name: mentor_info schema: public object_relationships: - - name: user - using: - foreign_key_constraint_on: mentor_id - name: userByMentorUuid using: foreign_key_constraint_on: mentor_uuid @@ -1802,15 +1778,9 @@ name: mentor_message schema: public object_relationships: - - name: from_user - using: - foreign_key_constraint_on: from_id - name: from_userbyuuid using: foreign_key_constraint_on: from_uuid - - name: to_user - using: - foreign_key_constraint_on: to_id - name: to_userbyuuid using: foreign_key_constraint_on: to_uuid @@ -1882,9 +1852,6 @@ - name: mentor using: foreign_key_constraint_on: mentor_info_id - - name: user - using: - foreign_key_constraint_on: user_id array_relationships: - name: history using: @@ -2037,9 +2004,6 @@ - name: mentor using: foreign_key_constraint_on: mentor_info_id - - name: user - using: - foreign_key_constraint_on: user_id insert_permissions: - role: EEsenior permission: @@ -2178,13 +2142,6 @@ - table: name: postgraduate_mentor_info schema: public - object_relationships: - - name: user - using: - foreign_key_constraint_on: user_id - - name: userEditor - using: - foreign_key_constraint_on: editor array_relationships: - name: applications using: @@ -2574,9 +2531,6 @@ name: scholarship_application schema: public object_relationships: - - name: student - using: - foreign_key_constraint_on: student_id - name: student_byuuid using: foreign_key_constraint_on: student_uuid @@ -2802,271 +2756,6 @@ - type - uuid filter: {} -- table: - name: user - schema: public - object_relationships: - - name: mentor_available - using: - manual_configuration: - column_mapping: - _id: mentor_id - insertion_order: null - remote_table: - name: mentor_available - schema: public - array_relationships: - - name: contest_team_members - using: - foreign_key_constraint_on: - column: user_id - table: - name: contest_team_member - schema: public - - name: contest_teams - using: - foreign_key_constraint_on: - column: team_leader - table: - name: contest_team - schema: public - - name: mentor_applications_mentor - using: - foreign_key_constraint_on: - column: mentor_id - table: - name: mentor_application - schema: public - - name: mentor_applications_student - using: - foreign_key_constraint_on: - column: student_id - table: - name: mentor_application - schema: public - - name: mentor_info - using: - foreign_key_constraint_on: - column: mentor_id - table: - name: mentor_info - schema: public - insert_permissions: - - role: root - permission: - check: {} - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - select_permissions: - - role: EEsenior - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: {} - allow_aggregations: true - - role: anonymous - permission: - columns: - - username - filter: {} - allow_aggregations: true - - role: counselor - permission: - columns: - - created_at - - updated_at - - username - - name - - department - - class - - phone - - id - - _id - - email - filter: {} - allow_aggregations: true - - role: root - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: {} - - role: student - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: {} - allow_aggregations: true - - role: teacher - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: {} - - role: user - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: - _id: - _eq: X-Hasura-User-Id - update_permissions: - - role: EEsenior - permission: - columns: - - class - - department - - email - - id - - name - - phone - - updated_at - - username - filter: - _id: - _eq: X-Hasura-User-Id - check: null - - role: counselor - permission: - columns: - - class - - department - - email - - id - - name - - phone - - username - filter: - _id: - _eq: X-Hasura-User-Id - check: - _id: - _eq: X-Hasura-User-Id - - role: root - permission: - columns: - - _id - - class - - created_at - - department - - email - - id - - name - - phone - - updated_at - - username - filter: {} - check: {} - - role: student - permission: - columns: - - class - - department - - email - - id - - name - - phone - - updated_at - - username - filter: - _id: - _eq: X-Hasura-User-Id - check: null - - role: teacher - permission: - columns: - - class - - department - - email - - id - - name - - phone - - username - filter: - _id: - _eq: X-Hasura-User-Id - check: null - delete_permissions: - - role: EEsenior - permission: - backend_only: false - filter: - _id: - _eq: X-Hasura-User-Id - - role: counselor - permission: - backend_only: false - filter: - _id: - _eq: X-Hasura-User-Id - - role: root - permission: - backend_only: false - filter: {} - - role: student - permission: - backend_only: false - filter: - _id: - _eq: X-Hasura-User-Id - - role: teacher - permission: - backend_only: false - filter: - _id: - _eq: X-Hasura-User-Id - table: name: users schema: public diff --git a/migrations/1710077526580_modify_primarykey_public_contest_team_member/down.sql b/migrations/1710077526580_modify_primarykey_public_contest_team_member/down.sql new file mode 100644 index 0000000..cf77741 --- /dev/null +++ b/migrations/1710077526580_modify_primarykey_public_contest_team_member/down.sql @@ -0,0 +1,4 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_pkey"; +alter table "public"."contest_team_member" + add constraint "contest_team_member_pkey" + primary key ("user_id", "team_id"); diff --git a/migrations/1710077526580_modify_primarykey_public_contest_team_member/up.sql b/migrations/1710077526580_modify_primarykey_public_contest_team_member/up.sql new file mode 100644 index 0000000..800c5d5 --- /dev/null +++ b/migrations/1710077526580_modify_primarykey_public_contest_team_member/up.sql @@ -0,0 +1,6 @@ +BEGIN TRANSACTION; +ALTER TABLE "public"."contest_team_member" DROP CONSTRAINT "contest_team_member_pkey"; + +ALTER TABLE "public"."contest_team_member" + ADD CONSTRAINT "contest_team_member_pkey" PRIMARY KEY ("user_uuid", "team_id"); +COMMIT TRANSACTION; diff --git a/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/down.sql b/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/down.sql new file mode 100644 index 0000000..c72cbc7 --- /dev/null +++ b/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/down.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" alter column "student_id" set not null; diff --git a/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/up.sql b/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/up.sql new file mode 100644 index 0000000..edf3593 --- /dev/null +++ b/migrations/1710077714051_alter_table_public_honor_application_alter_column_student_id/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" alter column "student_id" drop not null; diff --git a/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/down.sql b/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/down.sql new file mode 100644 index 0000000..00dc23c --- /dev/null +++ b/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" + add constraint "mentor_application_student_id_fkey1" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/up.sql b/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/up.sql new file mode 100644 index 0000000..c1cac8b --- /dev/null +++ b/migrations/1710078478629_delete_fk_public_mentor_application_mentor_application_student_id_fkey1/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_student_id_fkey1"; diff --git a/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/down.sql b/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/down.sql new file mode 100644 index 0000000..33bb8be --- /dev/null +++ b/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_application" + add constraint "mentor_application_mentor_id_fkey1" + foreign key ("mentor_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/up.sql b/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/up.sql new file mode 100644 index 0000000..16b8a62 --- /dev/null +++ b/migrations/1710078483254_delete_fk_public_mentor_application_mentor_application_mentor_id_fkey1/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" drop constraint "mentor_application_mentor_id_fkey1"; diff --git a/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/down.sql b/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/down.sql new file mode 100644 index 0000000..36bfee7 --- /dev/null +++ b/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."scholarship_application" + add constraint "scholarship_application_student_id_fkey" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/up.sql b/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/up.sql new file mode 100644 index 0000000..f558a19 --- /dev/null +++ b/migrations/1710078587045_delete_fk_public_scholarship_application_scholarship_application_student_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."scholarship_application" drop constraint "scholarship_application_student_id_fkey"; diff --git a/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/down.sql b/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/down.sql new file mode 100644 index 0000000..e4b0d75 --- /dev/null +++ b/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."postgraduate_mentor_info" + add constraint "postgraduate_mentor_info_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/up.sql b/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/up.sql new file mode 100644 index 0000000..03b9b17 --- /dev/null +++ b/migrations/1710081102168_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."postgraduate_mentor_info" drop constraint "postgraduate_mentor_info_user_id_fkey"; diff --git a/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/down.sql b/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/down.sql new file mode 100644 index 0000000..fb0c65f --- /dev/null +++ b/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."postgraduate_mentor_info" + add constraint "postgraduate_mentor_info_editor_fkey" + foreign key ("editor") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/up.sql b/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/up.sql new file mode 100644 index 0000000..a99b167 --- /dev/null +++ b/migrations/1710081106204_delete_fk_public_postgraduate_mentor_info_postgraduate_mentor_info_editor_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."postgraduate_mentor_info" drop constraint "postgraduate_mentor_info_editor_fkey"; diff --git a/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/down.sql b/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/down.sql new file mode 100644 index 0000000..90620ad --- /dev/null +++ b/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."postgraduate_application_history" + add constraint "postgraduate_application_history_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/up.sql b/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/up.sql new file mode 100644 index 0000000..f51bd05 --- /dev/null +++ b/migrations/1710081137866_delete_fk_public_postgraduate_application_history_postgraduate_application_history_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."postgraduate_application_history" drop constraint "postgraduate_application_history_user_id_fkey"; diff --git a/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/down.sql b/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/down.sql new file mode 100644 index 0000000..2733e81 --- /dev/null +++ b/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."postgraduate_application" + add constraint "postgraduate_application_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/up.sql b/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/up.sql new file mode 100644 index 0000000..968496d --- /dev/null +++ b/migrations/1710081172084_delete_fk_public_postgraduate_application_postgraduate_application_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."postgraduate_application" drop constraint "postgraduate_application_user_id_fkey"; diff --git a/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/down.sql b/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/down.sql new file mode 100644 index 0000000..dc1376a --- /dev/null +++ b/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" + add constraint "mentor_message_from_id_fkey" + foreign key ("from_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/up.sql b/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/up.sql new file mode 100644 index 0000000..eb94cc3 --- /dev/null +++ b/migrations/1710081259023_delete_fk_public_mentor_message_mentor_message_from_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_from_id_fkey"; diff --git a/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/down.sql b/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/down.sql new file mode 100644 index 0000000..7a99b80 --- /dev/null +++ b/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_message" + add constraint "mentor_message_to_id_fkey" + foreign key ("to_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/up.sql b/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/up.sql new file mode 100644 index 0000000..7522de8 --- /dev/null +++ b/migrations/1710081263806_delete_fk_public_mentor_message_mentor_message_to_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" drop constraint "mentor_message_to_id_fkey"; diff --git a/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/down.sql b/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/down.sql new file mode 100644 index 0000000..dc3de67 --- /dev/null +++ b/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_info" + add constraint "mentor_info_mentor_id_fkey" + foreign key ("mentor_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/up.sql b/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/up.sql new file mode 100644 index 0000000..187a354 --- /dev/null +++ b/migrations/1710081349251_delete_fk_public_mentor_info_mentor_info_mentor_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_info" drop constraint "mentor_info_mentor_id_fkey"; diff --git a/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/down.sql b/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/down.sql new file mode 100644 index 0000000..cca572a --- /dev/null +++ b/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."mentor_available" + add constraint "mentor_available_mentor_id_fkey" + foreign key ("mentor_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/up.sql b/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/up.sql new file mode 100644 index 0000000..ce06d00 --- /dev/null +++ b/migrations/1710081387219_delete_fk_public_mentor_available_mentor_available_mentor_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_available" drop constraint "mentor_available_mentor_id_fkey"; diff --git a/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/down.sql b/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/down.sql new file mode 100644 index 0000000..41eafce --- /dev/null +++ b/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team_member" + add constraint "contest_team_member_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/up.sql b/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/up.sql new file mode 100644 index 0000000..b22ceed --- /dev/null +++ b/migrations/1710081972268_delete_fk_public_contest_team_member_contest_team_member_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team_member" drop constraint "contest_team_member_user_id_fkey"; diff --git a/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/down.sql b/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/down.sql new file mode 100644 index 0000000..a29495a --- /dev/null +++ b/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_team" + add constraint "contest_team_team_leader_fkey" + foreign key ("team_leader") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/up.sql b/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/up.sql new file mode 100644 index 0000000..76beff8 --- /dev/null +++ b/migrations/1710081992196_delete_fk_public_contest_team_contest_team_team_leader_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop constraint "contest_team_team_leader_fkey"; diff --git a/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/down.sql b/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/down.sql new file mode 100644 index 0000000..402793a --- /dev/null +++ b/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."contest_manager" + add constraint "contest_manager_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/up.sql b/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/up.sql new file mode 100644 index 0000000..db8a0b5 --- /dev/null +++ b/migrations/1710082019794_delete_fk_public_contest_manager_contest_manager_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_manager" drop constraint "contest_manager_user_id_fkey"; diff --git a/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/down.sql b/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/down.sql new file mode 100644 index 0000000..8372d67 --- /dev/null +++ b/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."honor_application" + add constraint "honor_application_student_id_fkey" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/up.sql b/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/up.sql new file mode 100644 index 0000000..d19d458 --- /dev/null +++ b/migrations/1710082076557_delete_fk_public_honor_application_honor_application_student_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" drop constraint "honor_application_student_id_fkey"; diff --git a/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/down.sql b/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/down.sql new file mode 100644 index 0000000..8adea15 --- /dev/null +++ b/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."postgraduate_mentor_info_pending" + add constraint "postgraduate_mentor_info_pending_user_id_fkey" + foreign key ("user_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/up.sql b/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/up.sql new file mode 100644 index 0000000..fdbfc1a --- /dev/null +++ b/migrations/1710088179213_delete_fk_public_postgraduate_mentor_info_pending_postgraduate_mentor_info_pending_user_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."postgraduate_mentor_info_pending" drop constraint "postgraduate_mentor_info_pending_user_id_fkey"; diff --git a/migrations/1710088450231_set_fk_public_aid_application_student_id/down.sql b/migrations/1710088450231_set_fk_public_aid_application_student_id/down.sql new file mode 100644 index 0000000..8bd61a1 --- /dev/null +++ b/migrations/1710088450231_set_fk_public_aid_application_student_id/down.sql @@ -0,0 +1,5 @@ +alter table "public"."aid_application" drop constraint "aid_application_student_id_fkey", + add constraint "aid_application_student_id_fkey" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710088450231_set_fk_public_aid_application_student_id/up.sql b/migrations/1710088450231_set_fk_public_aid_application_student_id/up.sql new file mode 100644 index 0000000..8bd61a1 --- /dev/null +++ b/migrations/1710088450231_set_fk_public_aid_application_student_id/up.sql @@ -0,0 +1,5 @@ +alter table "public"."aid_application" drop constraint "aid_application_student_id_fkey", + add constraint "aid_application_student_id_fkey" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/down.sql b/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/down.sql new file mode 100644 index 0000000..de81cd2 --- /dev/null +++ b/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/down.sql @@ -0,0 +1,5 @@ +alter table "public"."aid_application" + add constraint "aid_application_student_id_fkey" + foreign key ("student_id") + references "public"."user" + ("_id") on update cascade on delete cascade; diff --git a/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/up.sql b/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/up.sql new file mode 100644 index 0000000..9186952 --- /dev/null +++ b/migrations/1710088453476_delete_fk_public_aid_application_aid_application_student_id_fkey/up.sql @@ -0,0 +1 @@ +alter table "public"."aid_application" drop constraint "aid_application_student_id_fkey"; diff --git a/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/down.sql b/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/down.sql new file mode 100644 index 0000000..ef99767 --- /dev/null +++ b/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/down.sql @@ -0,0 +1 @@ +alter table "public"."contest_team_member" alter column "user_id" set not null; diff --git a/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/up.sql b/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/up.sql new file mode 100644 index 0000000..0be1743 --- /dev/null +++ b/migrations/1710089438996_alter_table_public_contest_team_member_alter_column_user_id/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team_member" alter column "user_id" drop not null; diff --git a/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/down.sql b/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/down.sql new file mode 100644 index 0000000..69672cf --- /dev/null +++ b/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/down.sql @@ -0,0 +1 @@ +alter table "public"."mentor_available" alter column "available" set default 'true'; diff --git a/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/up.sql b/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/up.sql new file mode 100644 index 0000000..40e6943 --- /dev/null +++ b/migrations/1710089592993_alter_table_public_mentor_available_alter_column_available/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_available" alter column "available" set default 'false';