Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request eesast#152 from xiangmy21/dev
Browse files Browse the repository at this point in the history
feat(code): add contest_team_code & contest_team_player
  • Loading branch information
xiangmy21 authored Mar 17, 2024
2 parents 183b195 + 48adf24 commit 119f5d9
Show file tree
Hide file tree
Showing 13 changed files with 301 additions and 0 deletions.
276 changes: 276 additions & 0 deletions metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,27 @@
using:
foreign_key_constraint_on: team_leader_uuid
array_relationships:
- name: contest_team_codes
using:
foreign_key_constraint_on:
column: team_id
table:
name: contest_team_code
schema: public
- name: contest_team_members
using:
foreign_key_constraint_on:
column: team_id
table:
name: contest_team_member
schema: public
- name: contest_team_players
using:
foreign_key_constraint_on:
column: team_id
table:
name: contest_team_player
schema: public
insert_permissions:
- role: counselor
permission:
Expand Down Expand Up @@ -666,6 +680,153 @@
permission:
backend_only: false
filter: {}
- table:
name: contest_team_code
schema: public
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
- role: student
permission:
check: {}
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
- role: teacher
permission:
check: {}
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
- role: user
permission:
check: {}
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
select_permissions:
- role: counselor
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
- role: student
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
- role: teacher
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
- role: user
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
update_permissions:
- role: counselor
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
check: {}
- role: student
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
check: {}
- role: teacher
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
check: {}
- role: user
permission:
columns:
- code_id
- code_name
- compile_status
- created_at
- language
- team_id
filter: {}
check: {}
delete_permissions:
- role: counselor
permission:
backend_only: false
filter: {}
- role: student
permission:
backend_only: false
filter: {}
- role: teacher
permission:
backend_only: false
filter: {}
- role: user
permission:
backend_only: false
filter: {}
- table:
name: contest_team_member
schema: public
Expand Down Expand Up @@ -732,6 +893,121 @@
permission:
backend_only: false
filter: {}
- table:
name: contest_team_player
schema: public
object_relationships:
- name: player_code
using:
foreign_key_constraint_on: code_id
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- team_id
- player
- code_id
- role: student
permission:
check: {}
columns:
- team_id
- player
- code_id
- role: teacher
permission:
check: {}
columns:
- team_id
- player
- code_id
- role: user
permission:
check: {}
columns:
- team_id
- player
- code_id
select_permissions:
- role: counselor
permission:
columns:
- team_id
- player
- code_id
filter: {}
- role: student
permission:
columns:
- team_id
- player
- code_id
filter: {}
- role: teacher
permission:
columns:
- team_id
- player
- code_id
filter: {}
- role: user
permission:
columns:
- team_id
- player
- code_id
filter: {}
update_permissions:
- role: counselor
permission:
columns:
- team_id
- player
- code_id
filter: {}
check: {}
- role: student
permission:
columns:
- team_id
- player
- code_id
filter: {}
check: {}
- role: teacher
permission:
columns:
- team_id
- player
- code_id
filter: {}
check: {}
- role: user
permission:
columns:
- team_id
- player
- code_id
filter: {}
check: {}
delete_permissions:
- role: counselor
permission:
backend_only: false
filter: {}
- role: student
permission:
backend_only: false
filter: {}
- role: teacher
permission:
backend_only: false
filter: {}
- role: user
permission:
backend_only: false
filter: {}
- table:
name: honor_application
schema: public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."contest_team_code";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."contest_team_code" ("team_id" uuid NOT NULL, "code_id" uuid NOT NULL DEFAULT gen_random_uuid(), "code_name" text NOT NULL, "language" text NOT NULL, "compile_status" text NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("code_id") , UNIQUE ("code_id"));COMMENT ON TABLE "public"."contest_team_code" IS E'记录每个team上传的所有code';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment on table "public"."contest_team_code" is NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment on table "public"."contest_team_code" is E'记录每个team上传的所有code,角色应从上传的code中选择一份。';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."contest_team_player";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE "public"."contest_team_player" ("team_id" uuid NOT NULL, "player" text NOT NULL, "code_id" uuid, PRIMARY KEY ("team_id","player") );COMMENT ON TABLE "public"."contest_team_player" IS E'记录每个team的每个player选择了哪份code';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_team_player" drop constraint "contest_team_player_code_id_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_team_player"
add constraint "contest_team_player_code_id_fkey"
foreign key ("code_id")
references "public"."contest_team_code"
("code_id") on update restrict on delete set null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_team_code" drop constraint "contest_team_code_team_id_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_team_code"
add constraint "contest_team_code_team_id_fkey"
foreign key ("team_id")
references "public"."contest_team"
("team_id") on update restrict on delete cascade;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."contest_team_player" drop constraint "contest_team_player_team_id_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."contest_team_player"
add constraint "contest_team_player_team_id_fkey"
foreign key ("team_id")
references "public"."contest_team"
("team_id") on update restrict on delete cascade;

0 comments on commit 119f5d9

Please sign in to comment.