diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-07-27 17:18:40 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-07-27 17:18:40 +0200 |
| commit | 6722589b515ccee267212cf783fc0ebbaa20cd90 (patch) | |
| tree | 1220bf320a47dc5fe8a438da8443c788555f8edb /drizzle | |
| parent | 6cde16e66ddcb95f55aa2195910260d9b1faa88b (diff) | |
feat: catalog section + deduplicate items by name
- Show all items split into List (unchecked) and Catalog (checked) sections
- Tapping a catalog item unchecks it (returns to list)
- Add action now upserts: unchecks existing item instead of creating duplicate
- UNIQUE constraint on groceries.name as defense-in-depth
- Tests for dedup behavior (insert, re-add from catalog, no-op on list)
Diffstat (limited to 'drizzle')
| -rw-r--r-- | drizzle/0001_dear_bastion.sql | 1 | ||||
| -rw-r--r-- | drizzle/meta/0001_snapshot.json | 63 | ||||
| -rw-r--r-- | drizzle/meta/_journal.json | 7 |
3 files changed, 71 insertions, 0 deletions
diff --git a/drizzle/0001_dear_bastion.sql b/drizzle/0001_dear_bastion.sql new file mode 100644 index 0000000..ecc896d --- /dev/null +++ b/drizzle/0001_dear_bastion.sql @@ -0,0 +1 @@ +CREATE UNIQUE INDEX `groceries_name_unique` ON `groceries` (`name`);
\ No newline at end of file diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json new file mode 100644 index 0000000..92fe548 --- /dev/null +++ b/drizzle/meta/0001_snapshot.json @@ -0,0 +1,63 @@ +{ + "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 77a9b2e..7e6fb0d 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1785163537728, "tag": "0000_known_scarecrow", "breakpoints": true + }, + { + "idx": 1, + "version": "6", + "when": 1785165400399, + "tag": "0001_dear_bastion", + "breakpoints": true } ] } |
