aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/db
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-10-07 19:17:14 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-10-07 19:17:14 +0200
commit66939bab93cdcb9b7732c45d7bc3b99b6951fe15 (patch)
treeec6bc1631464410f8735da49e02e99abff0f3863 /src/lib/server/db
parent6e5dcdb53cea4c3f082d01c937fe5fc1d580c45b (diff)
feat: promote a reference as the primary shown in lists
Add an is_primary flag to references; the promoted ref sorts first on the item page and is the one shown under the item in the list and catalog. Item page gets a star toggle per reference.
Diffstat (limited to 'src/lib/server/db')
-rw-r--r--src/lib/server/db/schema.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts
index b6404ce..5eb6c15 100644
--- a/src/lib/server/db/schema.ts
+++ b/src/lib/server/db/schema.ts
@@ -32,6 +32,10 @@ export const references = sqliteTable('references', {
price: real('price'),
unit: text('unit'),
qualityScore: integer('quality_score'),
+ // Promoted ref shown first in lists; at most one per grocery.
+ isPrimary: integer('is_primary', { mode: 'boolean' })
+ .notNull()
+ .default(false),
});
export const projects = sqliteTable('projects', {