From 856344abfad039a727703e3f174147b654945632 Mon Sep 17 00:00:00 2001
From: "g.monteynard" <gdemonteynard@takima.fr>
Date: Tue, 4 Jul 2023 10:11:40 +0200
Subject: [PATCH] creation des premieres tables

---
 .../V1_0__user_and_list_and_todo_tables.sql   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 src/main/resources/db/migration/V1_0__user_and_list_and_todo_tables.sql

diff --git a/src/main/resources/db/migration/V1_0__user_and_list_and_todo_tables.sql b/src/main/resources/db/migration/V1_0__user_and_list_and_todo_tables.sql
new file mode 100644
index 0000000..f8392af
--- /dev/null
+++ b/src/main/resources/db/migration/V1_0__user_and_list_and_todo_tables.sql
@@ -0,0 +1,21 @@
+CREATE TABLE public.userb
+(
+    id      BIGSERIAL PRIMARY KEY,
+    name    VARCHAR NOT NULL
+);
+
+CREATE TABLE public.todo_list
+(
+    id      BIGSERIAL PRIMARY KEY,
+    name    VARCHAR NOT NULL,
+    user_id BIGINT  NOT NULL REFERENCES userb (id)
+);
+
+CREATE TABLE public.todo
+(
+    id          BIGSERIAL PRIMARY KEY,
+    name        VARCHAR   NOT NULL,
+    description VARCHAR,
+    checked     BOOLEAN   NOT NULL DEFAULT FALSE,
+    seller_id   BIGINT    NOT NULL REFERENCES todo_list (id)
+);
-- 
GitLab