From f3bc6d84ca8ebe92398cf56859328494ae4f30f0 Mon Sep 17 00:00:00 2001 From: Tianzhou Chen Date: Sat, 16 Mar 2024 01:51:39 +0800 Subject: [PATCH] chore: change script --- 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..9faaf92 --- /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 NOT NULL, + 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..5fe4274 --- /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