From 5607c7558178c8cc84ee1ec3d7f4b39dbfc10f4f Mon Sep 17 00:00:00 2001
From: Matthew Lemon <y@yulqen.org>
Date: Wed, 13 Mar 2024 16:23:18 +0000
Subject: Adds errors file and dbasik.sql

---
 migrations/dbasik.sql | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 migrations/dbasik.sql

(limited to 'migrations/dbasik.sql')

diff --git a/migrations/dbasik.sql b/migrations/dbasik.sql
new file mode 100644
index 0000000..b5bb6f9
--- /dev/null
+++ b/migrations/dbasik.sql
@@ -0,0 +1,32 @@
+CREATE TABLE "datamap" (
+  "id" int PRIMARY KEY,
+  "name" varchar,
+  "description" varchar
+);
+
+CREATE TABLE "datamapline" (
+  "id" uuid PRIMARY KEY,
+  "datamap_id" uuid,
+  "name" string,
+  "cellref" string,
+  "sheet" string,
+  "data_type" string
+);
+
+CREATE TABLE "returnitem" (
+  "id" uuid PRIMARY KEY,
+  "datamapline_id" uuid,
+  "return_id" int,
+  "value" string
+);
+
+CREATE TABLE "return" (
+  "id" int PRIMARY KEY,
+  "name" string
+);
+
+ALTER TABLE "datamapline" ADD FOREIGN KEY ("datamap_id") REFERENCES "datamap" ("id");
+
+ALTER TABLE "returnitem" ADD FOREIGN KEY ("datamapline_id") REFERENCES "datamapline" ("id");
+
+ALTER TABLE "returnitem" ADD FOREIGN KEY ("return_id") REFERENCES "return" ("id");
-- 
cgit v1.2.3

