From 637ebc4a53012c904363ccad8f9c1b4424f860fd Mon Sep 17 00:00:00 2001 From: Tianzhou Chen Date: Fri, 15 Mar 2024 02:28:26 +0800 Subject: [PATCH] feat: create uesr and post table --- migrations/1001_create_user.down.sql | 1 + migrations/1001_create_user.up.sql | 7 +++++++ migrations/1002_create_post.down.sql | 1 + migrations/1002_create_post.up.sql | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 migrations/1001_create_user.down.sql create mode 100644 migrations/1001_create_user.up.sql create mode 100644 migrations/1002_create_post.down.sql create mode 100644 migrations/1002_create_post.up.sql diff --git a/migrations/1001_create_user.down.sql b/migrations/1001_create_user.down.sql new file mode 100644 index 0000000..3f8392b --- /dev/null +++ b/migrations/1001_create_user.down.sql @@ -0,0 +1 @@ +DROP TABLE "user"; \ No newline at end of file diff --git a/migrations/1001_create_user.up.sql b/migrations/1001_create_user.up.sql new file mode 100644 index 0000000..604280c --- /dev/null +++ b/migrations/1001_create_user.up.sql @@ -0,0 +1,7 @@ +CREATE TABLE "user" ( + "id" SERIAL NOT NULL, + "firstName" character varying NOT NULL, + "lastName" character varying NOT NULL, + "age" integer, + CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id") +); \ No newline at end of file diff --git a/migrations/1002_create_post.down.sql b/migrations/1002_create_post.down.sql new file mode 100644 index 0000000..ee1ddeb --- /dev/null +++ b/migrations/1002_create_post.down.sql @@ -0,0 +1 @@ +DROP TABLE "post"; \ No newline at end of file diff --git a/migrations/1002_create_post.up.sql b/migrations/1002_create_post.up.sql new file mode 100644 index 0000000..3520608 --- /dev/null +++ b/migrations/1002_create_post.up.sql @@ -0,0 +1,5 @@ +CREATE TABLE "post" ( + "id" SERIAL NOT NULL, + "author" TEXT NOT NULL, + CONSTRAINT "PK_cace4a159ff9f2512dd42373761" PRIMARY KEY ("id") +); \ No newline at end of file