aboutsummaryrefslogtreecommitdiff
path: root/drizzle/0000_greedy_masked_marvel.sql
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 21:07:48 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 21:07:48 +0200
commitd9a200cd35a3d06173846a45c9f58acb1adf61aa (patch)
tree35f972193cc7ef7984705c61cd8b6f2aa48ff60e /drizzle/0000_greedy_masked_marvel.sql
parentbc3678461c3000c2394e355b7aaa73b774a33fff (diff)
refactor: rename brand to reference everywhere
Diffstat (limited to 'drizzle/0000_greedy_masked_marvel.sql')
-rw-r--r--drizzle/0000_greedy_masked_marvel.sql25
1 files changed, 25 insertions, 0 deletions
diff --git a/drizzle/0000_greedy_masked_marvel.sql b/drizzle/0000_greedy_masked_marvel.sql
new file mode 100644
index 0000000..45556f1
--- /dev/null
+++ b/drizzle/0000_greedy_masked_marvel.sql
@@ -0,0 +1,25 @@
+CREATE TABLE `categories` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `name` text NOT NULL
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `categories_name_unique` ON `categories` (`name`);--> statement-breakpoint
+CREATE TABLE `groceries` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `name` text NOT NULL,
+ `checked` integer DEFAULT false NOT NULL,
+ `created_at` text NOT NULL,
+ `category_id` integer,
+ FOREIGN KEY (`category_id`) REFERENCES `categories`(`id`) ON UPDATE no action ON DELETE no action
+);
+--> statement-breakpoint
+CREATE UNIQUE INDEX `groceries_name_unique` ON `groceries` (`name`);--> statement-breakpoint
+CREATE TABLE `references` (
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
+ `grocery_id` integer NOT NULL,
+ `reference` text NOT NULL,
+ `price` real,
+ `unit` text,
+ `quality_score` integer,
+ FOREIGN KEY (`grocery_id`) REFERENCES `groceries`(`id`) ON UPDATE no action ON DELETE cascade
+);