Skip to content

Commit

Permalink
fix: delete comment_comment table and and father relationship (eesast…
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdhybthu authored May 27, 2024
1 parent 6bea7f6 commit 6b7b5e8
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 177 deletions.
205 changes: 28 additions & 177 deletions metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2297,70 +2297,55 @@
- name: course
using:
foreign_key_constraint_on: course_id
- name: course_comment_parent
using:
foreign_key_constraint_on: parent_uuid
- name: user
using:
foreign_key_constraint_on: user_uuid
array_relationships:
- name: course_comment_comments
using:
foreign_key_constraint_on:
column: comment_uuid
table:
name: course_comment_comment
schema: public
- name: course_comment_likes
using:
foreign_key_constraint_on:
column: comment_uuid
table:
name: course_comment_like
schema: public
- name: course_comment_stars
using:
foreign_key_constraint_on:
column: comment_uuid
table:
name: course_comment_star
schema: public
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
- role: student
permission:
check: {}
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
- role: teacher
permission:
check: {}
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
select_permissions:
- role: counselor
permission:
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
filter: {}
Expand All @@ -2369,9 +2354,10 @@
permission:
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
filter: {}
Expand All @@ -2382,6 +2368,7 @@
- comment
- course_id
- created_at
- parent_uuid
- updated_at
- user_uuid
- uuid
Expand All @@ -2392,9 +2379,10 @@
permission:
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
filter: {}
Expand All @@ -2403,9 +2391,10 @@
permission:
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
filter: {}
Expand All @@ -2414,9 +2403,10 @@
permission:
columns:
- comment
- course_id
- created_at
- updated_at
- course_id
- parent_uuid
- user_uuid
- uuid
filter: {}
Expand All @@ -2435,117 +2425,7 @@
backend_only: false
filter: {}
- table:
name: course_comment_comment
schema: public
object_relationships:
- name: course_comment
using:
foreign_key_constraint_on: comment_uuid
- name: user
using:
foreign_key_constraint_on: user_uuid
insert_permissions:
- role: counselor
permission:
check: {}
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
- role: student
permission:
check: {}
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
- role: teacher
permission:
check: {}
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
select_permissions:
- role: counselor
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
filter: {}
- role: student
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
filter: {}
- role: teacher
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
filter: {}
update_permissions:
- role: counselor
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
filter: {}
check: {}
- role: student
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
filter: {}
check: {}
- role: teacher
permission:
columns:
- comment
- create_at
- update_at
- comment_uuid
- user_uuid
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: {}
- table:
name: course_comment_like
name: course_comment_likes
schema: public
object_relationships:
- name: course_comment
Expand Down Expand Up @@ -2580,18 +2460,21 @@
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
- role: student
permission:
columns:
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
- role: teacher
permission:
columns:
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
update_permissions:
- role: counselor
permission:
Expand Down Expand Up @@ -2628,7 +2511,7 @@
backend_only: false
filter: {}
- table:
name: course_comment_star
name: course_comment_stars
schema: public
object_relationships:
- name: course_comment
Expand Down Expand Up @@ -2663,18 +2546,21 @@
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
- role: student
permission:
columns:
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
- role: teacher
permission:
columns:
- comment_uuid
- user_uuid
filter: {}
allow_aggregations: true
update_permissions:
- role: counselor
permission:
Expand Down Expand Up @@ -3961,41 +3847,6 @@
table:
name: contest_team_member
schema: public
- name: course_comment_comments
using:
foreign_key_constraint_on:
column: user_uuid
table:
name: course_comment_comment
schema: public
- name: course_comment_likes
using:
foreign_key_constraint_on:
column: user_uuid
table:
name: course_comment_like
schema: public
- name: course_comment_stars
using:
foreign_key_constraint_on:
column: user_uuid
table:
name: course_comment_star
schema: public
- name: course_comments
using:
foreign_key_constraint_on:
column: user_uuid
table:
name: course_comment
schema: public
- name: course_ratings
using:
foreign_key_constraint_on:
column: user_uuid
table:
name: course_rating
schema: public
- name: mentor_application_as_mentor
using:
foreign_key_constraint_on:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- DROP table "public"."course_comment_comment";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP table "public"."course_comment_comment";
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"."course_comment" add column "parent_uuid" uuid
-- null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."course_comment" add column "parent_uuid" uuid
null;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."course_comment" drop constraint "course_comment_parent_uuid_fkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alter table "public"."course_comment"
add constraint "course_comment_parent_uuid_fkey"
foreign key ("parent_uuid")
references "public"."course_comment"
("uuid") on update restrict on delete restrict;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."course_comment_stars" rename to "course_comment_star";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."course_comment_star" rename to "course_comment_stars";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."course_comment_likes" rename to "course_comment_like";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."course_comment_like" rename to "course_comment_likes";

0 comments on commit 6b7b5e8

Please sign in to comment.