Преглед изворни кода

fix: correct table name from shop_contents to shop_content

Fixed SQLite error where getShopContent() and getShopContentById()
methods were querying the wrong table name. The table is created as
'shop_content' (singular) but queries used 'shop_contents' (plural),
causing SQLITE_ERROR when accessing shop embeddings.

This resolves the 500 error when trying to enable Qdrant for a shop
after database recreation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fszontagh пре 8 месеци
родитељ
комит
bd2f2fee0f
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/database/Database.ts

+ 2 - 2
src/database/Database.ts

@@ -1781,7 +1781,7 @@ export class ShopDatabase {
    */
    */
   getShopContent(shopId: string): any[] {
   getShopContent(shopId: string): any[] {
     const stmt = this.db.prepare(`
     const stmt = this.db.prepare(`
-      SELECT * FROM shop_contents
+      SELECT * FROM shop_content
       WHERE shop_id = ?
       WHERE shop_id = ?
       ORDER BY created_at DESC
       ORDER BY created_at DESC
     `);
     `);
@@ -1793,7 +1793,7 @@ export class ShopDatabase {
    */
    */
   getShopContentById(contentId: string): any | null {
   getShopContentById(contentId: string): any | null {
     const stmt = this.db.prepare(`
     const stmt = this.db.prepare(`
-      SELECT * FROM shop_contents
+      SELECT * FROM shop_content
       WHERE id = ?
       WHERE id = ?
     `);
     `);
     return stmt.get(contentId) as any | null;
     return stmt.get(contentId) as any | null;