forked from eesast/hasura
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: add tables related to course comment - likes, stars & comments (e…
- Loading branch information
Showing
17 changed files
with
364 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
migrations/1716647830860_create_schema_course_comment_likes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
drop schema "course_comment_likes" cascade; |
1 change: 1 addition & 0 deletions
1
migrations/1716647830860_create_schema_course_comment_likes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
create schema "course_comment_likes"; |
3 changes: 3 additions & 0 deletions
3
migrations/1716647853247_drop_schema_course_comment_likes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 schema "course_comment_likes" cascade; |
1 change: 1 addition & 0 deletions
1
migrations/1716647853247_drop_schema_course_comment_likes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
drop schema "course_comment_likes" cascade; |
1 change: 1 addition & 0 deletions
1
migrations/1716648034386_create_table_public_course_comment_likes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."course_comment_likes"; |
1 change: 1 addition & 0 deletions
1
migrations/1716648034386_create_table_public_course_comment_likes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE "public"."course_comment_likes" ("comment_uuid" uuid NOT NULL, "user_uuid" uuid NOT NULL, PRIMARY KEY ("comment_uuid","user_uuid") , FOREIGN KEY ("comment_uuid") REFERENCES "public"."course_comment"("uuid") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("user_uuid") REFERENCES "public"."users"("uuid") ON UPDATE restrict ON DELETE restrict); |
1 change: 1 addition & 0 deletions
1
migrations/1716648079409_rename_table_public_course_comment_likes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."course_comment_like" rename to "course_comment_likes"; |
1 change: 1 addition & 0 deletions
1
migrations/1716648079409_rename_table_public_course_comment_likes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."course_comment_likes" rename to "course_comment_like"; |
1 change: 1 addition & 0 deletions
1
migrations/1716648207596_create_table_public_course_comment_star/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."course_comment_star"; |
1 change: 1 addition & 0 deletions
1
migrations/1716648207596_create_table_public_course_comment_star/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE "public"."course_comment_star" ("comment_uuid" uuid NOT NULL, "user_uuid" uuid NOT NULL, PRIMARY KEY ("comment_uuid","user_uuid") , FOREIGN KEY ("comment_uuid") REFERENCES "public"."course_comment"("uuid") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("user_uuid") REFERENCES "public"."users"("uuid") ON UPDATE restrict ON DELETE restrict); |
4 changes: 4 additions & 0 deletions
4
migrations/1716648788527_alter_table_public_course_comment_drop_column_star/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
comment on column "public"."course_comment"."star" is E'用户评论表'; | ||
alter table "public"."course_comment" alter column "star" set default 0; | ||
alter table "public"."course_comment" alter column "star" drop not null; | ||
alter table "public"."course_comment" add column "star" int4; |
1 change: 1 addition & 0 deletions
1
migrations/1716648788527_alter_table_public_course_comment_drop_column_star/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."course_comment" drop column "star" cascade; |
4 changes: 4 additions & 0 deletions
4
migrations/1716648798356_alter_table_public_course_comment_drop_column_like/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
comment on column "public"."course_comment"."like" is E'用户评论表'; | ||
alter table "public"."course_comment" alter column "like" set default 0; | ||
alter table "public"."course_comment" alter column "like" drop not null; | ||
alter table "public"."course_comment" add column "like" int4; |
1 change: 1 addition & 0 deletions
1
migrations/1716648798356_alter_table_public_course_comment_drop_column_like/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."course_comment" drop column "like" cascade; |
1 change: 1 addition & 0 deletions
1
migrations/1716648953179_create_table_public_course_comment_comment/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."course_comment_comment"; |
1 change: 1 addition & 0 deletions
1
migrations/1716648953179_create_table_public_course_comment_comment/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE "public"."course_comment_comment" ("comment_uuid" uuid NOT NULL, "user_uuid" uuid NOT NULL, "comment" text NOT NULL, "create_at" timestamptz NOT NULL DEFAULT now(), "update_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("comment_uuid","user_uuid") , FOREIGN KEY ("comment_uuid") REFERENCES "public"."course_comment"("uuid") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("user_uuid") REFERENCES "public"."users"("uuid") ON UPDATE restrict ON DELETE restrict); |