From 349eafbe62abf025dc3ae4936e0ab7d93509eaf5 Mon Sep 17 00:00:00 2001 From: sysadmin Date: Tue, 18 Nov 2025 15:41:24 +0000 Subject: [PATCH] fix: Implement empty AddVariantCollectionsAndSalesLedger migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added VariantCollectionId and VariantsJson columns to Products table - Migration was previously empty causing schema mismatch on startup - Fixes "SQLite Error 1: 'no such column: p.VariantCollectionId'" The migration file was scaffolded but never implemented, causing production deployments to fail with database schema errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- ...4850_AddVariantCollectionsAndSalesLedger.cs | 18 ++++++++++++++++++ ...0928014851_FixVariantColumnsForProducts.sql | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 LittleShop/Migrations/20250928014851_FixVariantColumnsForProducts.sql diff --git a/LittleShop/Migrations/20250928014850_AddVariantCollectionsAndSalesLedger.cs b/LittleShop/Migrations/20250928014850_AddVariantCollectionsAndSalesLedger.cs index 7fceff8..45dd10e 100644 --- a/LittleShop/Migrations/20250928014850_AddVariantCollectionsAndSalesLedger.cs +++ b/LittleShop/Migrations/20250928014850_AddVariantCollectionsAndSalesLedger.cs @@ -10,13 +10,31 @@ namespace LittleShop.Migrations /// protected override void Up(MigrationBuilder migrationBuilder) { + // Add variant columns to Products table + migrationBuilder.AddColumn( + name: "VariantCollectionId", + table: "Products", + type: "TEXT", + nullable: true); + migrationBuilder.AddColumn( + name: "VariantsJson", + table: "Products", + type: "TEXT", + nullable: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { + // Remove variant columns from Products table + migrationBuilder.DropColumn( + name: "VariantCollectionId", + table: "Products"); + migrationBuilder.DropColumn( + name: "VariantsJson", + table: "Products"); } } } diff --git a/LittleShop/Migrations/20250928014851_FixVariantColumnsForProducts.sql b/LittleShop/Migrations/20250928014851_FixVariantColumnsForProducts.sql new file mode 100644 index 0000000..204ad2c --- /dev/null +++ b/LittleShop/Migrations/20250928014851_FixVariantColumnsForProducts.sql @@ -0,0 +1,8 @@ +-- Migration: Fix Variant Columns for Products +-- Date: 2025-09-28 +-- Description: Adds missing VariantCollectionId and VariantsJson columns to Products table +-- This fixes the empty AddVariantCollectionsAndSalesLedger migration + +-- Add variant columns to Products table +ALTER TABLE Products ADD COLUMN VariantCollectionId TEXT NULL; +ALTER TABLE Products ADD COLUMN VariantsJson TEXT NULL;