From 66939bab93cdcb9b7732c45d7bc3b99b6951fe15 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 7 Oct 2026 19:17:14 +0200 Subject: 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. --- src/lib/server/db/schema.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/server/db/schema.ts') 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', { -- cgit v1.3