Skip to content

Commit

Permalink
Merge pull request #136 from xiangmy21/dev
Browse files Browse the repository at this point in the history
refact(uuid): add many ..._uuid
xiangmy21 authored Dec 17, 2023
2 parents f1e1c0d + 9f785bb commit 49342bd
Showing 33 changed files with 169 additions and 39 deletions.
116 changes: 77 additions & 39 deletions metadata/tables.yaml
Original file line number Diff line number Diff line change
@@ -5,21 +5,25 @@
- name: student
using:
foreign_key_constraint_on: student_id
- name: user
using:
foreign_key_constraint_on: student_uuid
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- id
- created_at
- updated_at
- aid
- amount
- code
- created_at
- form_url
- id
- status
- student_id
- student_uuid
- thank_letter
- code
- form_url
- updated_at
- role: root
permission:
check: {}
@@ -54,16 +58,17 @@
- role: counselor
permission:
columns:
- amount
- aid
- amount
- code
- created_at
- form_url
- id
- status
- student_id
- student_uuid
- thank_letter
- created_at
- updated_at
- id
filter: {}
- role: root
permission:
@@ -83,16 +88,17 @@
- role: student
permission:
columns:
- id
- created_at
- updated_at
- aid
- amount
- code
- created_at
- form_url
- id
- status
- student_id
- student_uuid
- thank_letter
- code
- form_url
- updated_at
filter:
student_id:
_eq: X-Hasura-User-Id
@@ -533,13 +539,17 @@
- name: user
using:
foreign_key_constraint_on: user_id
- name: userByUserUuid
using:
foreign_key_constraint_on: user_uuid
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- user_id
- contest_id
- user_id
- user_uuid
- role: root
permission:
check: {}
@@ -550,8 +560,9 @@
- role: counselor
permission:
columns:
- user_id
- contest_id
- user_id
- user_uuid
filter: {}
- role: root
permission:
@@ -564,13 +575,15 @@
columns:
- contest_id
- user_id
- user_uuid
filter: {}
update_permissions:
- role: counselor
permission:
columns:
- user_id
- contest_id
- user_id
- user_uuid
filter: {}
check: {}
- role: root
@@ -703,6 +716,9 @@
- name: team_contest_id
using:
foreign_key_constraint_on: contest_id
- name: team_leader_byuuid
using:
foreign_key_constraint_on: team_leader_uuid
- name: team_leader_id
using:
foreign_key_constraint_on: team_leader
@@ -732,17 +748,18 @@
check: {}
columns:
- contest_id
- contest_score
- created_at
- invited_code
- member_num
- score
- status
- status2
- contest_score
- submitted_code_num
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- updated_at
- role: root
@@ -775,6 +792,7 @@
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- updated_at
select_permissions:
@@ -799,20 +817,21 @@
- role: counselor
permission:
columns:
- submitted_code_num
- contest_id
- contest_score
- created_at
- invited_code
- member_num
- score
- status
- status2
- contest_score
- submitted_code_num
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- created_at
- updated_at
- contest_id
- team_id
- member_num
filter: {}
- role: root
permission:
@@ -836,17 +855,18 @@
permission:
columns:
- contest_id
- contest_score
- created_at
- invited_code
- member_num
- score
- status
- status2
- contest_score
- submitted_code_num
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- updated_at
filter: {}
@@ -867,17 +887,18 @@
- role: counselor
permission:
columns:
- contest_score
- created_at
- invited_code
- member_num
- score
- status
- status2
- contest_score
- submitted_code_num
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- updated_at
filter: {}
@@ -906,6 +927,7 @@
- team_id
- team_intro
- team_leader
- team_leader_uuid
- team_name
- updated_at
filter: {}
@@ -934,6 +956,9 @@
- name: team_as_contest_team_member
using:
foreign_key_constraint_on: team_id
- name: user
using:
foreign_key_constraint_on: user_uuid
- name: user_as_contest_team_member
using:
foreign_key_constraint_on: user_id
@@ -944,6 +969,7 @@
columns:
- team_id
- user_id
- user_uuid
- role: root
permission:
check: {}
@@ -956,12 +982,14 @@
columns:
- team_id
- user_id
- user_uuid
select_permissions:
- role: counselor
permission:
columns:
- user_id
- team_id
- user_id
- user_uuid
filter: {}
- role: root
permission:
@@ -972,15 +1000,17 @@
- role: student
permission:
columns:
- user_id
- team_id
- user_id
- user_uuid
filter: {}
update_permissions:
- role: counselor
permission:
columns:
- user_id
- team_id
- user_id
- user_uuid
filter: {}
check: null
- role: root
@@ -993,8 +1023,9 @@
- role: student
permission:
columns:
- user_id
- team_id
- user_id
- user_uuid
filter: {}
check: null
delete_permissions:
@@ -1017,6 +1048,9 @@
- name: student
using:
foreign_key_constraint_on: student_id
- name: user
using:
foreign_key_constraint_on: student_uuid
insert_permissions:
- role: EEsenior
permission:
@@ -1060,6 +1094,7 @@
- statement
- status
- student_id
- student_uuid
select_permissions:
- role: EEsenior
permission:
@@ -1078,14 +1113,15 @@
- role: counselor
permission:
columns:
- id
- created_at
- updated_at
- student_id
- statement
- attachment_url
- created_at
- honor
- id
- statement
- status
- student_id
- student_uuid
- updated_at
filter: {}
- role: root
permission:
@@ -1103,14 +1139,15 @@
- role: student
permission:
columns:
- id
- created_at
- updated_at
- student_id
- statement
- attachment_url
- created_at
- honor
- id
- statement
- status
- student_id
- student_uuid
- updated_at
filter:
student_id:
_eq: X-Hasura-User-Id
@@ -1162,6 +1199,7 @@
- statement
- status
- student_id
- student_uuid
filter:
_and:
- student_id:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."aid_application" alter column "student_uuid" drop not null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."aid_application" alter column "student_uuid" set not null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."aid_application" drop constraint "aid_application_student_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."aid_application"
add constraint "aid_application_student_uuid_fkey"
foreign key ("student_uuid")
references "public"."users"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."contest_manager" add column "user_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."contest_manager" add column "user_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_manager" drop constraint "contest_manager_user_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_manager"
add constraint "contest_manager_user_uuid_fkey"
foreign key ("user_uuid")
references "public"."users"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."contest_team" add column "team_leader_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."contest_team" add column "team_leader_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_team" drop constraint "contest_team_team_leader_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_team"
add constraint "contest_team_team_leader_uuid_fkey"
foreign key ("team_leader_uuid")
references "public"."users"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."contest_team_member" add column "user_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."contest_team_member" add column "user_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_team_member" drop constraint "contest_team_member_user_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_team_member"
add constraint "contest_team_member_user_uuid_fkey"
foreign key ("user_uuid")
references "public"."users"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."honor_application" add column "student_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."honor_application" add column "student_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."honor_application" drop constraint "honor_application_student_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."honor_application"
add constraint "honor_application_student_uuid_fkey"
foreign key ("student_uuid")
references "public"."users"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_application" add column "mentor_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_application" add column "mentor_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_application" add column "student_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_application" add column "student_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_available" add column "mentor_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_available" add column "mentor_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_info" add column "mentor_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_info" add column "mentor_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_message" add column "from_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_message" add column "from_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."mentor_message" add column "to_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."mentor_message" add column "to_uuid" uuid
null;

0 comments on commit 49342bd

Please sign in to comment.