aboutsummaryrefslogtreecommitdiff
path: root/drizzle/meta
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 18:31:26 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 18:31:26 +0200
commite14717b2e7853705469275d64023bb902b195ebb (patch)
tree2e450f7b4e864e232d06df43ad1aba1b62be4f4c /drizzle/meta
parent8224c7d6572db6ec76c4224eec1df8a538b47ad4 (diff)
feat: separate categories table + /categories management page
- Categories table (id, name unique) with FK from groceries.category_id - /categories page for add/delete categories - Main page uses native <select> dropdown for category - Categories grouped by name in list/catalog views - Regenerated drizzle migrations from scratch
Diffstat (limited to 'drizzle/meta')
-rw-r--r--drizzle/meta/0000_snapshot.json59
-rw-r--r--drizzle/meta/0001_snapshot.json63
-rw-r--r--drizzle/meta/_journal.json11
3 files changed, 58 insertions, 75 deletions
diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json
index 99fa112..6e33354 100644
--- a/drizzle/meta/0000_snapshot.json
+++ b/drizzle/meta/0000_snapshot.json
@@ -1,9 +1,39 @@
{
"version": "6",
"dialect": "sqlite",
- "id": "265bc06f-5de9-43a2-9427-39ce061f134c",
+ "id": "54c7ae45-9838-4ffb-ad46-29995def7272",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
+ "categories": {
+ "name": "categories",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "categories_name_unique": {
+ "name": "categories_name_unique",
+ "columns": ["name"],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
"groceries": {
"name": "groceries",
"columns": {
@@ -35,10 +65,33 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false
+ },
+ "category_id": {
+ "name": "category_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "groceries_name_unique": {
+ "name": "groceries_name_unique",
+ "columns": ["name"],
+ "isUnique": true
+ }
+ },
+ "foreignKeys": {
+ "groceries_category_id_categories_id_fk": {
+ "name": "groceries_category_id_categories_id_fk",
+ "tableFrom": "groceries",
+ "tableTo": "categories",
+ "columnsFrom": ["category_id"],
+ "columnsTo": ["id"],
+ "onDelete": "no action",
+ "onUpdate": "no action"
}
},
- "indexes": {},
- "foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json
deleted file mode 100644
index 92fe548..0000000
--- a/drizzle/meta/0001_snapshot.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "b20afe62-9a50-42b6-bb34-1be35863e817",
- "prevId": "265bc06f-5de9-43a2-9427-39ce061f134c",
- "tables": {
- "groceries": {
- "name": "groceries",
- "columns": {
- "id": {
- "name": "id",
- "type": "integer",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": true
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "checked": {
- "name": "checked",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "groceries_name_unique": {
- "name": "groceries_name_unique",
- "columns": ["name"],
- "isUnique": true
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
index 7e6fb0d..2923632 100644
--- a/drizzle/meta/_journal.json
+++ b/drizzle/meta/_journal.json
@@ -5,15 +5,8 @@
{
"idx": 0,
"version": "6",
- "when": 1785163537728,
- "tag": "0000_known_scarecrow",
- "breakpoints": true
- },
- {
- "idx": 1,
- "version": "6",
- "when": 1785165400399,
- "tag": "0001_dear_bastion",
+ "when": 1785169427572,
+ "tag": "0000_youthful_mercury",
"breakpoints": true
}
]