From 04fabf115ccea31ac504b06cc51d78423b697f60 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 28 Jul 2026 15:07:57 +0200 Subject: refactor: services layer, valibot validation, shared CSS utilities, aria labels, and drizzle migrate - Extract groceries/categories/references services with db injection - Add valibot for form validation and safe numeric id parsing - Fix category delete FK behavior with onDelete: set null + migration - Replace custom migrate.js with drizzle-orm/libsql/migrator - Add shared CSS utility classes in app.css (forms, lists, buttons) - Add aria-pressed and aria-label on interactive elements - Remove redundant app.css imports and unused /stores import - Add integration tests for all services using drizzle migrate helper - Remove smoke test; add db:migrate and db:studio scripts --- drizzle/0001_big_rachel_grey.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 drizzle/0001_big_rachel_grey.sql (limited to 'drizzle/0001_big_rachel_grey.sql') diff --git a/drizzle/0001_big_rachel_grey.sql b/drizzle/0001_big_rachel_grey.sql new file mode 100644 index 0000000..539cad6 --- /dev/null +++ b/drizzle/0001_big_rachel_grey.sql @@ -0,0 +1,15 @@ +PRAGMA foreign_keys=OFF;--> statement-breakpoint +CREATE TABLE `__new_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 set null +); +--> statement-breakpoint +INSERT INTO `__new_groceries`("id", "name", "checked", "created_at", "category_id") SELECT "id", "name", "checked", "created_at", "category_id" FROM `groceries`;--> statement-breakpoint +DROP TABLE `groceries`;--> statement-breakpoint +ALTER TABLE `__new_groceries` RENAME TO `groceries`;--> statement-breakpoint +PRAGMA foreign_keys=ON;--> statement-breakpoint +CREATE UNIQUE INDEX `groceries_name_unique` ON `groceries` (`name`); \ No newline at end of file -- cgit v1.3