From 582c03eacbc73b851aa232c404be71b2cf77295a Mon Sep 17 00:00:00 2001
From: Joris
Date: Fri, 7 Feb 2025 10:35:20 +0100
Subject: Use strict mode for tables

---
 src/db/migrations/02-categories.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 src/db/migrations/02-categories.sql

(limited to 'src/db/migrations/02-categories.sql')

diff --git a/src/db/migrations/02-categories.sql b/src/db/migrations/02-categories.sql
new file mode 100644
index 0000000..0b373d0
--- /dev/null
+++ b/src/db/migrations/02-categories.sql
@@ -0,0 +1,11 @@
+CREATE TABLE IF NOT EXISTS "categories" (
+  "id" TEXT PRIMARY KEY, /* UUID */
+  "name" TEXT NOT NULL UNIQUE,
+  "color" TEXT NOT NULL, /* COLOR */
+  "created" TEXT NOT NULL, /* DATETIME */
+  "updated" TEXT NOT NULL /* DATETIME */
+);
+
+ALTER TABLE "events" ADD COLUMN "category" TEXT REFERENCES "categories" ("id"); /* UUID */
+
+PRAGMA foreign_keys = ON
-- 
cgit v1.2.3

