aboutsummaryrefslogtreecommitdiff
path: root/drizzle/0000_youthful_mercury.sql
blob: 6dde7ff13fbf2a84da481d3b7095130e81570943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

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`);