From 254fc482dbf4e9773c1294f350d530fb727e65bf Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Tue, 14 Apr 2026 10:40:20 -0700 Subject: [PATCH] feat: add ebay_categories migration for LLM query builder category cache --- app/db/migrations/011_ebay_categories.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/db/migrations/011_ebay_categories.sql diff --git a/app/db/migrations/011_ebay_categories.sql b/app/db/migrations/011_ebay_categories.sql new file mode 100644 index 0000000..84ac6f4 --- /dev/null +++ b/app/db/migrations/011_ebay_categories.sql @@ -0,0 +1,16 @@ +-- app/db/migrations/011_ebay_categories.sql +-- eBay category leaf node cache. Refreshed weekly via EbayCategoryCache.refresh(). +-- Seeded with a small bootstrap table when no eBay API credentials are configured. +-- MIT License + +CREATE TABLE IF NOT EXISTS ebay_categories ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + category_id TEXT NOT NULL UNIQUE, + name TEXT NOT NULL, + full_path TEXT NOT NULL, -- "Consumer Electronics > ... > Leaf Name" + is_leaf INTEGER NOT NULL DEFAULT 1, -- SQLite stores bool as int + refreshed_at TEXT NOT NULL -- ISO8601 timestamp +); + +CREATE INDEX IF NOT EXISTS idx_ebay_cat_name + ON ebay_categories (name);