Skip to content

Commit

Permalink
feat: create uesr and post table
Browse files Browse the repository at this point in the history
  • Loading branch information
tianzhou committed Mar 14, 2024
1 parent 8e00d61 commit 637ebc4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions migrations/1001_create_user.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "user";
7 changes: 7 additions & 0 deletions migrations/1001_create_user.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE "user" (
"id" SERIAL NOT NULL,
"firstName" character varying NOT NULL,
"lastName" character varying NOT NULL,
"age" integer,

Check warning on line 5 in migrations/1001_create_user.up.sql

View workflow job for this annotation

GitHub Actions / SQL Review

column.no-null (402)

Column "age" in "public"."user" cannot have NULL value. https://www.bytebase.com/docs/reference/error-code/advisor#402
CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id")
);
1 change: 1 addition & 0 deletions migrations/1002_create_post.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "post";
5 changes: 5 additions & 0 deletions migrations/1002_create_post.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE "post" (
"id" SERIAL NOT NULL,
"author" TEXT NOT NULL,
CONSTRAINT "PK_cace4a159ff9f2512dd42373761" PRIMARY KEY ("id")
);

0 comments on commit 637ebc4

Please sign in to comment.