using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Prefab.Web.Data.Migrations
{
///
public partial class Initial : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "catalog");
migrationBuilder.CreateTable(
name: "AttributeDefinitions",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
DataType = table.Column(type: "int", nullable: false),
Unit = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttributeDefinitions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AuditLogs",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CorrelationId = table.Column(type: "uniqueidentifier", nullable: false),
Entity = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
State = table.Column(type: "nvarchar(max)", nullable: false),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Categories",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ParentId = table.Column(type: "uniqueidentifier", nullable: true),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
Slug = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
DisplayOrder = table.Column(type: "int", nullable: false),
IsFeatured = table.Column(type: "bit", nullable: false),
HeroImageUrl = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true),
Icon = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "GenericAttributes",
columns: table => new
{
EntityId = table.Column(type: "uniqueidentifier", nullable: false),
KeyGroup = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false),
Key = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false),
Type = table.Column(type: "nvarchar(max)", nullable: false),
Value = table.Column(type: "nvarchar(max)", maxLength: 2147483647, nullable: false),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GenericAttributes", x => new { x.EntityId, x.KeyGroup, x.Key });
});
migrationBuilder.CreateTable(
name: "Products",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Kind = table.Column(type: "int", nullable: false),
Sku = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
Slug = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
Description = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
Price = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
ParentProductId = table.Column(type: "uniqueidentifier", nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.Id);
table.ForeignKey(
name: "FK_Products_Products_ParentProductId",
column: x => x.ParentProductId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "SeederLogs",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SeederName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
RunMode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
RunAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SeederLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AuditLogItems",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AuditLogId = table.Column(type: "int", nullable: false),
Property = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
OldValue = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
NewValue = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AuditLogItems", x => x.Id);
table.ForeignKey(
name: "FK_AuditLogItems_AuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "OptionDefinitions",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ProductId = table.Column(type: "uniqueidentifier", nullable: false),
Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
DataType = table.Column(type: "int", nullable: false),
IsVariantAxis = table.Column(type: "bit", nullable: false),
Unit = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true),
Min = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
Max = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
Step = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
PricePerUnit = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
PercentScope = table.Column(type: "int", nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OptionDefinitions", x => x.Id);
table.ForeignKey(
name: "FK_OptionDefinitions_Products_ProductId",
column: x => x.ProductId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "OptionRuleSets",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ProductId = table.Column(type: "uniqueidentifier", nullable: false),
TargetKind = table.Column(type: "tinyint", nullable: false),
TargetId = table.Column(type: "uniqueidentifier", nullable: false),
Effect = table.Column(type: "tinyint", nullable: false),
Mode = table.Column(type: "tinyint", nullable: false),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OptionRuleSets", x => x.Id);
table.ForeignKey(
name: "FK_OptionRuleSets_Products_ProductId",
column: x => x.ProductId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ProductAttributeValues",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ProductId = table.Column(type: "uniqueidentifier", nullable: false),
AttributeDefinitionId = table.Column(type: "uniqueidentifier", nullable: false),
Value = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
NumericValue = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
UnitCode = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true),
EnumCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProductAttributeValues", x => x.Id);
table.ForeignKey(
name: "FK_ProductAttributeValues_AttributeDefinitions_AttributeDefinitionId",
column: x => x.AttributeDefinitionId,
principalSchema: "catalog",
principalTable: "AttributeDefinitions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ProductAttributeValues_Products_ProductId",
column: x => x.ProductId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ProductCategories",
schema: "catalog",
columns: table => new
{
ProductId = table.Column(type: "uniqueidentifier", nullable: false),
CategoryId = table.Column(type: "uniqueidentifier", nullable: false),
IsPrimary = table.Column(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProductCategories", x => new { x.ProductId, x.CategoryId });
table.ForeignKey(
name: "FK_ProductCategories_Categories_CategoryId",
column: x => x.CategoryId,
principalSchema: "catalog",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_ProductCategories_Products_ProductId",
column: x => x.ProductId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "OptionTiers",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
OptionDefinitionId = table.Column(type: "uniqueidentifier", nullable: false),
FromInclusive = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false),
ToInclusive = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
UnitRate = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false),
FlatDelta = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OptionTiers", x => x.Id);
table.ForeignKey(
name: "FK_OptionTiers_OptionDefinitions_OptionDefinitionId",
column: x => x.OptionDefinitionId,
principalSchema: "catalog",
principalTable: "OptionDefinitions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "OptionValues",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
OptionDefinitionId = table.Column(type: "uniqueidentifier", nullable: false),
Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Label = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
PriceDelta = table.Column(type: "decimal(9,4)", precision: 9, scale: 4, nullable: true),
PriceDeltaKind = table.Column(type: "int", nullable: false),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OptionValues", x => x.Id);
table.ForeignKey(
name: "FK_OptionValues_OptionDefinitions_OptionDefinitionId",
column: x => x.OptionDefinitionId,
principalSchema: "catalog",
principalTable: "OptionDefinitions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "OptionRuleConditions",
schema: "catalog",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
RuleSetId = table.Column(type: "uniqueidentifier", nullable: false),
LeftOptionDefinitionId = table.Column(type: "uniqueidentifier", nullable: false),
Operator = table.Column(type: "tinyint", nullable: false),
RightOptionValueId = table.Column(type: "uniqueidentifier", nullable: true),
RightList = table.Column(type: "nvarchar(max)", nullable: true),
RightNumber = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
RightMin = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
RightMax = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true),
CreatedBy = table.Column(type: "uniqueidentifier", nullable: false),
CreatedOn = table.Column(type: "datetimeoffset", nullable: false),
LastModifiedBy = table.Column(type: "uniqueidentifier", nullable: false),
LastModifiedOn = table.Column(type: "datetimeoffset", nullable: false),
InactivatedBy = table.Column(type: "uniqueidentifier", nullable: true),
InactivatedOn = table.Column(type: "datetimeoffset", nullable: true),
DeletedBy = table.Column(type: "uniqueidentifier", nullable: true),
DeletedOn = table.Column(type: "datetimeoffset", nullable: true),
RowVersion = table.Column(type: "rowversion", rowVersion: true, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OptionRuleConditions", x => x.Id);
table.ForeignKey(
name: "FK_OptionRuleConditions_OptionDefinitions_LeftOptionDefinitionId",
column: x => x.LeftOptionDefinitionId,
principalSchema: "catalog",
principalTable: "OptionDefinitions",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OptionRuleConditions_OptionRuleSets_RuleSetId",
column: x => x.RuleSetId,
principalSchema: "catalog",
principalTable: "OptionRuleSets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OptionRuleConditions_OptionValues_RightOptionValueId",
column: x => x.RightOptionValueId,
principalSchema: "catalog",
principalTable: "OptionValues",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "VariantAxisValues",
schema: "catalog",
columns: table => new
{
ProductVariantId = table.Column(type: "uniqueidentifier", nullable: false),
OptionDefinitionId = table.Column(type: "uniqueidentifier", nullable: false),
OptionValueId = table.Column(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VariantAxisValues", x => new { x.ProductVariantId, x.OptionDefinitionId });
table.ForeignKey(
name: "FK_VariantAxisValues_OptionDefinitions_OptionDefinitionId",
column: x => x.OptionDefinitionId,
principalSchema: "catalog",
principalTable: "OptionDefinitions",
principalColumn: "Id");
table.ForeignKey(
name: "FK_VariantAxisValues_OptionValues_OptionValueId",
column: x => x.OptionValueId,
principalSchema: "catalog",
principalTable: "OptionValues",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_VariantAxisValues_Products_ProductVariantId",
column: x => x.ProductVariantId,
principalSchema: "catalog",
principalTable: "Products",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_AuditLogItems_AuditLogId",
table: "AuditLogItems",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_Categories_Slug",
schema: "catalog",
table: "Categories",
column: "Slug",
unique: true,
filter: "[Slug] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_GenericAttributes_Active",
table: "GenericAttributes",
column: "DeletedOn",
filter: "[DeletedOn] IS NULL");
migrationBuilder.CreateIndex(
name: "IX_GenericAttributes_Entity_Group",
table: "GenericAttributes",
columns: new[] { "EntityId", "KeyGroup" });
migrationBuilder.CreateIndex(
name: "IX_OptionDefinitions_ProductId_Code",
schema: "catalog",
table: "OptionDefinitions",
columns: new[] { "ProductId", "Code" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_OptionRuleConditions_LeftOptionDefinitionId",
schema: "catalog",
table: "OptionRuleConditions",
column: "LeftOptionDefinitionId");
migrationBuilder.CreateIndex(
name: "IX_OptionRuleConditions_RightOptionValueId",
schema: "catalog",
table: "OptionRuleConditions",
column: "RightOptionValueId");
migrationBuilder.CreateIndex(
name: "IX_OptionRuleConditions_RuleSetId",
schema: "catalog",
table: "OptionRuleConditions",
column: "RuleSetId");
migrationBuilder.CreateIndex(
name: "IX_OptionRuleSets_ProductId_TargetKind_TargetId",
schema: "catalog",
table: "OptionRuleSets",
columns: new[] { "ProductId", "TargetKind", "TargetId" });
migrationBuilder.CreateIndex(
name: "IX_OptionTiers_OptionDefinitionId_FromInclusive_ToInclusive",
schema: "catalog",
table: "OptionTiers",
columns: new[] { "OptionDefinitionId", "FromInclusive", "ToInclusive" });
migrationBuilder.CreateIndex(
name: "IX_OptionValues_OptionDefinitionId_Code",
schema: "catalog",
table: "OptionValues",
columns: new[] { "OptionDefinitionId", "Code" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ProductAttributeValues_AttributeDefinitionId",
schema: "catalog",
table: "ProductAttributeValues",
column: "AttributeDefinitionId");
migrationBuilder.CreateIndex(
name: "IX_ProductAttributeValues_ProductId_AttributeDefinitionId",
schema: "catalog",
table: "ProductAttributeValues",
columns: new[] { "ProductId", "AttributeDefinitionId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ProductCategories_CategoryId",
schema: "catalog",
table: "ProductCategories",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Products_ParentProductId",
schema: "catalog",
table: "Products",
column: "ParentProductId");
migrationBuilder.CreateIndex(
name: "IX_Products_Sku",
schema: "catalog",
table: "Products",
column: "Sku",
unique: true,
filter: "[Sku] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Products_Slug",
schema: "catalog",
table: "Products",
column: "Slug",
unique: true,
filter: "[Slug] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_VariantAxisValues_OptionDefinitionId",
schema: "catalog",
table: "VariantAxisValues",
column: "OptionDefinitionId");
migrationBuilder.CreateIndex(
name: "IX_VariantAxisValues_OptionValueId",
schema: "catalog",
table: "VariantAxisValues",
column: "OptionValueId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AuditLogItems");
migrationBuilder.DropTable(
name: "GenericAttributes");
migrationBuilder.DropTable(
name: "OptionRuleConditions",
schema: "catalog");
migrationBuilder.DropTable(
name: "OptionTiers",
schema: "catalog");
migrationBuilder.DropTable(
name: "ProductAttributeValues",
schema: "catalog");
migrationBuilder.DropTable(
name: "ProductCategories",
schema: "catalog");
migrationBuilder.DropTable(
name: "SeederLogs");
migrationBuilder.DropTable(
name: "VariantAxisValues",
schema: "catalog");
migrationBuilder.DropTable(
name: "AuditLogs");
migrationBuilder.DropTable(
name: "OptionRuleSets",
schema: "catalog");
migrationBuilder.DropTable(
name: "AttributeDefinitions",
schema: "catalog");
migrationBuilder.DropTable(
name: "Categories",
schema: "catalog");
migrationBuilder.DropTable(
name: "OptionValues",
schema: "catalog");
migrationBuilder.DropTable(
name: "OptionDefinitions",
schema: "catalog");
migrationBuilder.DropTable(
name: "Products",
schema: "catalog");
}
}
}