diff --git a/metadata/tables.yaml b/metadata/tables.yaml index 0d8dbb9..bca94d3 100644 --- a/metadata/tables.yaml +++ b/metadata/tables.yaml @@ -137,16 +137,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: {} @@ -155,16 +153,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: {} @@ -173,16 +169,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: {} @@ -191,16 +185,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: {} @@ -209,16 +201,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: {} @@ -228,16 +218,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: @@ -250,16 +238,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: @@ -272,16 +258,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: @@ -294,16 +278,14 @@ columns: - arena_switch - code_upload_switch - - fullname - - contest_type - description - end_date + - fullname - id - name - playback_switch - playground_switch - start_date - - status - stream_switch - team_switch filter: @@ -311,152 +293,6 @@ user_uuid: _eq: X-Hasura-User-Id check: {} -- table: - name: contest_code - schema: public - insert_permissions: - - role: counselor - permission: - check: {} - columns: - - team_id - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - created_at - - updated_at - - contest_id - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - role: student - permission: - check: {} - columns: - - team_id - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - created_at - - updated_at - - contest_id - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - code_type1 - - code_type2 - - code_type3 - - code_type4 - - code_type5 - - code_type6 - select_permissions: - - role: counselor - permission: - columns: - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - created_at - - updated_at - - contest_id - - team_id - filter: {} - - role: student - permission: - columns: - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - code_type1 - - code_type2 - - code_type3 - - code_type4 - - code_type5 - - code_type6 - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - created_at - - updated_at - - contest_id - - team_id - filter: {} - update_permissions: - - role: counselor - permission: - columns: - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - created_at - - updated_at - - contest_id - - team_id - filter: {} - check: null - - role: student - permission: - columns: - - code1 - - code2 - - code3 - - code4 - - code5 - - code6 - - code_type1 - - code_type2 - - code_type3 - - code_type4 - - code_type5 - - code_type6 - - code1_update_time - - code2_update_time - - code3_update_time - - code4_update_time - - code5_update_time - - code6_update_time - - created_at - - updated_at - - contest_id - - team_id - filter: {} - check: null - table: name: contest_manager schema: public @@ -1032,71 +868,61 @@ - role: anonymous permission: columns: - - status - - result - - created_at - - room_id - contest_id + - created_at + - map_id - port + - room_id - round_id - - map_id - - updated_at + - status filter: {} allow_aggregations: true - role: counselor permission: columns: - - status - - result - - created_at - - room_id - contest_id + - created_at + - map_id - port + - room_id - round_id - - map_id - - updated_at + - status filter: {} allow_aggregations: true - role: student permission: columns: - - status - - result - - created_at - - room_id - contest_id + - created_at + - map_id - port + - room_id - round_id - - map_id - - updated_at + - status filter: {} allow_aggregations: true - role: teacher permission: columns: - - status - - result - - created_at - - room_id - contest_id + - created_at + - map_id - port + - room_id - round_id - - map_id - - updated_at + - status filter: {} allow_aggregations: true - role: user permission: columns: - - status - - result - - created_at - - room_id - contest_id + - created_at + - map_id - port + - room_id - round_id - - map_id - - updated_at + - status filter: {} allow_aggregations: true - table: @@ -1420,14 +1246,8 @@ check: {} columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1438,14 +1258,8 @@ check: {} columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1456,14 +1270,8 @@ check: {} columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1474,14 +1282,8 @@ check: {} columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1492,14 +1294,8 @@ permission: columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1511,14 +1307,8 @@ permission: columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1530,14 +1320,8 @@ permission: columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1549,14 +1333,8 @@ permission: columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1568,14 +1346,8 @@ permission: columns: - contest_id - - contest_score - created_at - invited_code - - member_num - - score - - status - - status2 - - submitted_code_num - team_id - team_intro - team_leader_uuid @@ -1587,20 +1359,14 @@ - role: counselor permission: columns: - - submitted_code_num - - contest_score + - contest_id + - created_at - invited_code - - score - - status - - status2 + - team_id - team_intro + - team_leader_uuid - team_name - - created_at - updated_at - - contest_id - - team_id - - team_leader_uuid - - member_num filter: contest_team_members: user_uuid: @@ -1609,20 +1375,14 @@ - role: student permission: columns: - - submitted_code_num - - contest_score + - contest_id + - created_at - invited_code - - score - - status - - status2 + - team_id - team_intro + - team_leader_uuid - team_name - - created_at - updated_at - - contest_id - - team_id - - team_leader_uuid - - member_num filter: contest_team_members: user_uuid: @@ -1631,20 +1391,14 @@ - role: teacher permission: columns: - - submitted_code_num - - contest_score + - contest_id + - created_at - invited_code - - score - - status - - status2 + - team_id - team_intro + - team_leader_uuid - team_name - - created_at - updated_at - - contest_id - - team_id - - team_leader_uuid - - member_num filter: contest_team_members: user_uuid: @@ -1653,20 +1407,14 @@ - role: user permission: columns: - - submitted_code_num - - contest_score + - contest_id + - created_at - invited_code - - score - - status - - status2 + - team_id - team_intro + - team_leader_uuid - team_name - - created_at - updated_at - - contest_id - - team_id - - team_leader_uuid - - member_num filter: contest_team_members: user_uuid: diff --git a/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/down.sql b/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/down.sql new file mode 100644 index 0000000..aeadde6 --- /dev/null +++ b/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/down.sql @@ -0,0 +1,2 @@ +alter table "public"."contest" alter column "contest_type" drop not null; +alter table "public"."contest" add column "contest_type" text; diff --git a/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/up.sql b/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/up.sql new file mode 100644 index 0000000..d1dabc6 --- /dev/null +++ b/migrations/1715063931438_alter_table_public_contest_drop_column_contest_type/up.sql @@ -0,0 +1 @@ +alter table "public"."contest" drop column "contest_type" cascade; diff --git a/migrations/1715063947225_alter_table_public_contest_drop_column_status/down.sql b/migrations/1715063947225_alter_table_public_contest_drop_column_status/down.sql new file mode 100644 index 0000000..c793d3e --- /dev/null +++ b/migrations/1715063947225_alter_table_public_contest_drop_column_status/down.sql @@ -0,0 +1,3 @@ +alter table "public"."contest" alter column "status" set default ''000'::text'; +alter table "public"."contest" alter column "status" drop not null; +alter table "public"."contest" add column "status" text; diff --git a/migrations/1715063947225_alter_table_public_contest_drop_column_status/up.sql b/migrations/1715063947225_alter_table_public_contest_drop_column_status/up.sql new file mode 100644 index 0000000..08a05ca --- /dev/null +++ b/migrations/1715063947225_alter_table_public_contest_drop_column_status/up.sql @@ -0,0 +1 @@ +alter table "public"."contest" drop column "status" cascade; diff --git a/migrations/1715063980529_drop_table_public_contest_code/down.sql b/migrations/1715063980529_drop_table_public_contest_code/down.sql new file mode 100644 index 0000000..7d657c7 --- /dev/null +++ b/migrations/1715063980529_drop_table_public_contest_code/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- DROP table "public"."contest_code"; diff --git a/migrations/1715063980529_drop_table_public_contest_code/up.sql b/migrations/1715063980529_drop_table_public_contest_code/up.sql new file mode 100644 index 0000000..759a82d --- /dev/null +++ b/migrations/1715063980529_drop_table_public_contest_code/up.sql @@ -0,0 +1 @@ +DROP table "public"."contest_code"; diff --git a/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/down.sql b/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/down.sql new file mode 100644 index 0000000..a52bcda --- /dev/null +++ b/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/down.sql @@ -0,0 +1,3 @@ +alter table "public"."contest_room" alter column "updated_at" set default now(); +alter table "public"."contest_room" alter column "updated_at" drop not null; +alter table "public"."contest_room" add column "updated_at" timestamptz; diff --git a/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/up.sql b/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/up.sql new file mode 100644 index 0000000..1b37433 --- /dev/null +++ b/migrations/1715064066508_alter_table_public_contest_room_drop_column_updated_at/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_room" drop column "updated_at" cascade; diff --git a/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/down.sql b/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/down.sql new file mode 100644 index 0000000..db7dbec --- /dev/null +++ b/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/down.sql @@ -0,0 +1,2 @@ +alter table "public"."contest_room" alter column "result" drop not null; +alter table "public"."contest_room" add column "result" text; diff --git a/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/up.sql b/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/up.sql new file mode 100644 index 0000000..dc6f341 --- /dev/null +++ b/migrations/1715064080796_alter_table_public_contest_room_drop_column_result/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_room" drop column "result" cascade; diff --git a/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/down.sql b/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/down.sql new file mode 100644 index 0000000..1ad75f4 --- /dev/null +++ b/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/down.sql @@ -0,0 +1,4 @@ +comment on column "public"."contest_team"."score" is E'比赛队伍'; +alter table "public"."contest_team" alter column "score" set default ''200'::text'; +alter table "public"."contest_team" alter column "score" drop not null; +alter table "public"."contest_team" add column "score" text; diff --git a/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/up.sql b/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/up.sql new file mode 100644 index 0000000..7c4e2fa --- /dev/null +++ b/migrations/1715064278689_alter_table_public_contest_team_drop_column_score/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "score" cascade; diff --git a/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/down.sql b/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/down.sql new file mode 100644 index 0000000..f568e19 --- /dev/null +++ b/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."contest_team"."status" is E'比赛队伍'; +alter table "public"."contest_team" alter column "status" drop not null; +alter table "public"."contest_team" add column "status" text; diff --git a/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/up.sql b/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/up.sql new file mode 100644 index 0000000..4d133a1 --- /dev/null +++ b/migrations/1715064294668_alter_table_public_contest_team_drop_column_status/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "status" cascade; diff --git a/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/down.sql b/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/down.sql new file mode 100644 index 0000000..1e2d890 --- /dev/null +++ b/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."contest_team"."status2" is E'比赛队伍'; +alter table "public"."contest_team" alter column "status2" drop not null; +alter table "public"."contest_team" add column "status2" text; diff --git a/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/up.sql b/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/up.sql new file mode 100644 index 0000000..1960382 --- /dev/null +++ b/migrations/1715064307917_alter_table_public_contest_team_drop_column_status2/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "status2" cascade; diff --git a/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/down.sql b/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/down.sql new file mode 100644 index 0000000..bbbe323 --- /dev/null +++ b/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."contest_team"."contest_score" is E'比赛队伍'; +alter table "public"."contest_team" alter column "contest_score" drop not null; +alter table "public"."contest_team" add column "contest_score" text; diff --git a/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/up.sql b/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/up.sql new file mode 100644 index 0000000..8023b10 --- /dev/null +++ b/migrations/1715064321419_alter_table_public_contest_team_drop_column_contest_score/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "contest_score" cascade; diff --git a/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/down.sql b/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/down.sql new file mode 100644 index 0000000..04e4376 --- /dev/null +++ b/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/down.sql @@ -0,0 +1,4 @@ +comment on column "public"."contest_team"."member_num" is E'比赛队伍'; +alter table "public"."contest_team" alter column "member_num" set default 1; +alter table "public"."contest_team" alter column "member_num" drop not null; +alter table "public"."contest_team" add column "member_num" int4; diff --git a/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/up.sql b/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/up.sql new file mode 100644 index 0000000..274917a --- /dev/null +++ b/migrations/1715064336396_alter_table_public_contest_team_drop_column_member_num/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "member_num" cascade; diff --git a/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/down.sql b/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/down.sql new file mode 100644 index 0000000..79d1398 --- /dev/null +++ b/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/down.sql @@ -0,0 +1,4 @@ +comment on column "public"."contest_team"."submitted_code_num" is E'比赛队伍'; +alter table "public"."contest_team" alter column "submitted_code_num" set default 0; +alter table "public"."contest_team" alter column "submitted_code_num" drop not null; +alter table "public"."contest_team" add column "submitted_code_num" int4; diff --git a/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/up.sql b/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/up.sql new file mode 100644 index 0000000..187eaad --- /dev/null +++ b/migrations/1715064353564_alter_table_public_contest_team_drop_column_submitted_code_num/up.sql @@ -0,0 +1 @@ +alter table "public"."contest_team" drop column "submitted_code_num" cascade;