- 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 <noreply@anthropic.com>
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace LittleShop.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddVariantCollectionsAndSalesLedger : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
// Add variant columns to Products table
|
|
migrationBuilder.AddColumn<Guid?>(
|
|
name: "VariantCollectionId",
|
|
table: "Products",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "VariantsJson",
|
|
table: "Products",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
// Remove variant columns from Products table
|
|
migrationBuilder.DropColumn(
|
|
name: "VariantCollectionId",
|
|
table: "Products");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "VariantsJson",
|
|
table: "Products");
|
|
}
|
|
}
|
|
}
|