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;