diff --git a/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.Designer.cs b/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.Designer.cs
new file mode 100644
index 0000000..aa5cb88
--- /dev/null
+++ b/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.Designer.cs
@@ -0,0 +1,1212 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Printbase.Infrastructure.Database;
+
+#nullable disable
+
+namespace Printbase.Infrastructure.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20250527103204_InitialSetup")]
+ partial class InitialSetup
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.5")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ProviderKey")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("RoleId")
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Value")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Notes")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("OrderDate")
+ .HasColumnType("datetime2");
+
+ b.Property("OrderNumber")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("OrderStatusId")
+ .HasColumnType("int");
+
+ b.Property("ShippingStatusId")
+ .HasColumnType("int");
+
+ b.Property("TotalPrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_Order_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_Order_CreatedBy");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_Order_ModifiedAt");
+
+ b.HasIndex("OrderDate")
+ .HasDatabaseName("IX_Order_OrderDate");
+
+ b.HasIndex("OrderNumber")
+ .IsUnique()
+ .HasDatabaseName("IX_Order_OrderNumber");
+
+ b.HasIndex("OrderStatusId")
+ .HasDatabaseName("IX_Order_OrderStatusId");
+
+ b.HasIndex("ShippingStatusId")
+ .HasDatabaseName("IX_Order_ShippingStatusId");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("IX_Order_UserId");
+
+ b.HasIndex("UserId", "OrderDate")
+ .HasDatabaseName("IX_Order_User_Date");
+
+ b.ToTable("Orders");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("City")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PostalCode")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("State")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Street")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_OrderAddress_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_OrderAddress_CreatedBy");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_OrderAddress_ModifiedAt");
+
+ b.HasIndex("OrderId")
+ .IsUnique()
+ .HasDatabaseName("IX_OrderAddress_OrderId");
+
+ b.ToTable("OrderAddresses");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("CustomizationDescription")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)");
+
+ b.Property("CustomizationImageUrl")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("OrderId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProductVariantId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Quantity")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasDefaultValue(1);
+
+ b.Property("TotalPrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("UnitPrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_OrderItem_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_OrderItem_CreatedBy");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_OrderItem_ModifiedAt");
+
+ b.HasIndex("OrderId")
+ .HasDatabaseName("IX_OrderItem_OrderId");
+
+ b.HasIndex("ProductId")
+ .HasDatabaseName("IX_OrderItem_ProductId");
+
+ b.HasIndex("ProductVariantId")
+ .HasDatabaseName("IX_OrderItem_ProductVariantId");
+
+ b.HasIndex("OrderId", "ProductId")
+ .HasDatabaseName("IX_OrderItem_Order_Product");
+
+ b.ToTable("OrderItems");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("int");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_OrderStatus_Name");
+
+ b.ToTable("OrderStatuses");
+
+ b.HasData(
+ new
+ {
+ Id = 0,
+ Name = "Pending"
+ },
+ new
+ {
+ Id = 1,
+ Name = "Processing"
+ },
+ new
+ {
+ Id = 2,
+ Name = "Completed"
+ },
+ new
+ {
+ Id = 3,
+ Name = "Cancelled"
+ });
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("int");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name")
+ .IsUnique()
+ .HasDatabaseName("IX_ShippingStatus_Name");
+
+ b.ToTable("ShippingStatuses");
+
+ b.HasData(
+ new
+ {
+ Id = 0,
+ Name = "Prepping"
+ },
+ new
+ {
+ Id = 1,
+ Name = "Packaging"
+ },
+ new
+ {
+ Id = 2,
+ Name = "Shipped"
+ },
+ new
+ {
+ Id = 3,
+ Name = "Delivered"
+ });
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)");
+
+ b.Property("ImageUrl")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("ParentCategoryId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SortOrder")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasDefaultValue(0);
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_Category_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_Category_CreatedBy");
+
+ b.HasIndex("IsActive")
+ .HasDatabaseName("IX_Category_IsActive");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_Category_ModifiedAt");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_Category_Name");
+
+ b.HasIndex("ParentCategoryId")
+ .HasDatabaseName("IX_Category_ParentCategoryId");
+
+ b.HasIndex("IsActive", "SortOrder")
+ .HasDatabaseName("IX_Category_Active_SortOrder");
+
+ b.HasIndex("ParentCategoryId", "SortOrder")
+ .HasDatabaseName("IX_Category_Parent_SortOrder");
+
+ b.ToTable("Categories");
+
+ b.HasData(
+ new
+ {
+ Id = new Guid("11111111-1111-1111-1111-111111111111"),
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ CreatedBy = "system@printbase.com",
+ Description = "Textile and fabric-based products",
+ IsActive = true,
+ ModifiedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ ModifiedBy = "system@printbase.com",
+ Name = "Textile",
+ SortOrder = 1
+ },
+ new
+ {
+ Id = new Guid("22222222-2222-2222-2222-222222222222"),
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ CreatedBy = "system@printbase.com",
+ Description = "Products for hard surface printing",
+ IsActive = true,
+ ModifiedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ ModifiedBy = "system@printbase.com",
+ Name = "Hard Surfaces",
+ SortOrder = 2
+ },
+ new
+ {
+ Id = new Guid("33333333-3333-3333-3333-333333333333"),
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ CreatedBy = "system@printbase.com",
+ Description = "Paper-based printing products",
+ IsActive = true,
+ ModifiedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ ModifiedBy = "system@printbase.com",
+ Name = "Paper",
+ SortOrder = 3
+ });
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("BasePrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CategoryId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Description")
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)");
+
+ b.Property("ImageUrl")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("IsCustomizable")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CategoryId")
+ .HasDatabaseName("IX_Product_CategoryId");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_Product_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_Product_CreatedBy");
+
+ b.HasIndex("IsActive")
+ .HasDatabaseName("IX_Product_IsActive");
+
+ b.HasIndex("IsCustomizable")
+ .HasDatabaseName("IX_Product_IsCustomizable");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_Product_ModifiedAt");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_Product_Name");
+
+ b.HasIndex("CategoryId", "IsActive")
+ .HasDatabaseName("IX_Product_Category_Active");
+
+ b.HasIndex("IsActive", "IsCustomizable")
+ .HasDatabaseName("IX_Product_Active_Customizable");
+
+ b.ToTable("Products");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("Color")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ImageUrl")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ProductId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Size")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Sku")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("StockQuantity")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasDefaultValue(0);
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_ProductVariant_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_ProductVariant_CreatedBy");
+
+ b.HasIndex("IsActive")
+ .HasDatabaseName("IX_ProductVariant_IsActive");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_ProductVariant_ModifiedAt");
+
+ b.HasIndex("ProductId")
+ .HasDatabaseName("IX_ProductVariant_ProductId");
+
+ b.HasIndex("Sku")
+ .IsUnique()
+ .HasDatabaseName("IX_ProductVariant_SKU");
+
+ b.HasIndex("ProductId", "Size", "Color")
+ .IsUnique()
+ .HasDatabaseName("IX_ProductVariant_Product_Size_Color")
+ .HasFilter("[Color] IS NOT NULL");
+
+ b.ToTable("ProductVariants");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasDefaultValueSql("NEWID()");
+
+ b.Property("AddressType")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("City")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Country")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("IsDefault")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
+
+ b.Property("ModifiedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("ModifiedBy")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("PostalCode")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("State")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Street")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasMaxLength(450)
+ .HasColumnType("nvarchar(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedAt")
+ .HasDatabaseName("IX_Address_CreatedAt");
+
+ b.HasIndex("CreatedBy")
+ .HasDatabaseName("IX_Address_CreatedBy");
+
+ b.HasIndex("ModifiedAt")
+ .HasDatabaseName("IX_Address_ModifiedAt");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("IX_Address_UserId");
+
+ b.HasIndex("UserId", "AddressType")
+ .HasDatabaseName("IX_Address_User_Type");
+
+ b.HasIndex("UserId", "IsDefault")
+ .HasDatabaseName("IX_Address_User_Default");
+
+ b.ToTable("Addresses");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("IsActive")
+ .HasDatabaseName("IX_ApplicationRole_IsActive");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex")
+ .HasFilter("[NormalizedName] IS NOT NULL");
+
+ b.ToTable("AspNetRoles", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = "1",
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ Description = "Full system access",
+ IsActive = true,
+ Name = "Administrator",
+ NormalizedName = "ADMINISTRATOR"
+ },
+ new
+ {
+ Id = "2",
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ Description = "Standard customer access",
+ IsActive = true,
+ Name = "Customer",
+ NormalizedName = "CUSTOMER"
+ },
+ new
+ {
+ Id = "3",
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ Description = "Manage orders and fulfillment",
+ IsActive = true,
+ Name = "OrderManager",
+ NormalizedName = "ORDERMANAGER"
+ },
+ new
+ {
+ Id = "4",
+ CreatedAt = new DateTime(2025, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
+ Description = "Manage products and inventory",
+ IsActive = true,
+ Name = "ProductManager",
+ NormalizedName = "PRODUCTMANAGER"
+ });
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("DateOfBirth")
+ .HasColumnType("datetime2");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("IsActive")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(true);
+
+ b.Property("LastLoginAt")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime2")
+ .HasDefaultValueSql("GETUTCDATE()");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("ProfileImageUrl")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex")
+ .HasFilter("[NormalizedUserName] IS NOT NULL");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Orders.OrderStatus", "OrderStatus")
+ .WithMany("Orders")
+ .HasForeignKey("OrderStatusId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Printbase.Domain.Entities.Orders.ShippingStatus", "ShippingStatus")
+ .WithMany("Orders")
+ .HasForeignKey("ShippingStatusId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany("Orders")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("OrderStatus");
+
+ b.Navigation("ShippingStatus");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderAddress", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
+ .WithOne("OrderAddress")
+ .HasForeignKey("Printbase.Domain.Entities.Orders.OrderAddress", "OrderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Order");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderItem", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Orders.Order", "Order")
+ .WithMany("OrderItems")
+ .HasForeignKey("OrderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
+ .WithMany("OrderItems")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Printbase.Domain.Entities.Product.ProductVariant", "ProductVariant")
+ .WithMany("OrderItems")
+ .HasForeignKey("ProductVariantId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("Order");
+
+ b.Navigation("Product");
+
+ b.Navigation("ProductVariant");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Product.Category", "ParentCategory")
+ .WithMany("SubCategories")
+ .HasForeignKey("ParentCategoryId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("ParentCategory");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Product.Category", "Category")
+ .WithMany("Products")
+ .HasForeignKey("CategoryId")
+ .OnDelete(DeleteBehavior.SetNull);
+
+ b.Navigation("Category");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Product.Product", "Product")
+ .WithMany("ProductVariants")
+ .HasForeignKey("ProductId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Product");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Users.Address", b =>
+ {
+ b.HasOne("Printbase.Domain.Entities.Users.ApplicationUser", null)
+ .WithMany("Addresses")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.Order", b =>
+ {
+ b.Navigation("OrderAddress")
+ .IsRequired();
+
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.OrderStatus", b =>
+ {
+ b.Navigation("Orders");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Orders.ShippingStatus", b =>
+ {
+ b.Navigation("Orders");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Category", b =>
+ {
+ b.Navigation("Products");
+
+ b.Navigation("SubCategories");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.Product", b =>
+ {
+ b.Navigation("OrderItems");
+
+ b.Navigation("ProductVariants");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Product.ProductVariant", b =>
+ {
+ b.Navigation("OrderItems");
+ });
+
+ modelBuilder.Entity("Printbase.Domain.Entities.Users.ApplicationUser", b =>
+ {
+ b.Navigation("Addresses");
+
+ b.Navigation("Orders");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.cs b/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.cs
new file mode 100644
index 0000000..63d3e63
--- /dev/null
+++ b/src/Printbase.Infrastructure/Migrations/20250527103204_InitialSetup.cs
@@ -0,0 +1,824 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
+
+namespace Printbase.Infrastructure.Migrations
+{
+ ///
+ public partial class InitialSetup : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AspNetRoles",
+ columns: table => new
+ {
+ Id = table.Column(type: "nvarchar(450)", nullable: false),
+ Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
+ IsActive = table.Column(type: "bit", nullable: false, defaultValue: true),
+ Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoles", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUsers",
+ columns: table => new
+ {
+ Id = table.Column(type: "nvarchar(450)", nullable: false),
+ FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ DateOfBirth = table.Column(type: "datetime2", nullable: true),
+ CreatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
+ LastLoginAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
+ IsActive = table.Column(type: "bit", nullable: false, defaultValue: true),
+ ProfileImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
+ UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ EmailConfirmed = table.Column(type: "bit", nullable: false),
+ PasswordHash = table.Column(type: "nvarchar(max)", nullable: true),
+ SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true),
+ PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true),
+ PhoneNumberConfirmed = table.Column(type: "bit", nullable: false),
+ TwoFactorEnabled = table.Column(type: "bit", nullable: false),
+ LockoutEnd = table.Column(type: "datetimeoffset", nullable: true),
+ LockoutEnabled = table.Column(type: "bit", nullable: false),
+ AccessFailedCount = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUsers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Categories",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
+ Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
+ Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false),
+ ImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
+ SortOrder = table.Column(type: "int", nullable: false, defaultValue: 0),
+ IsActive = table.Column(type: "bit", nullable: false, defaultValue: true),
+ ParentCategoryId = table.Column(type: "uniqueidentifier", nullable: true),
+ CreatedAt = table.Column(type: "datetime2", nullable: true),
+ ModifiedAt = table.Column(type: "datetime2", nullable: true, defaultValueSql: "GETUTCDATE()"),
+ CreatedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
+ ModifiedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Categories", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Categories_Categories_ParentCategoryId",
+ column: x => x.ParentCategoryId,
+ principalTable: "Categories",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OrderStatuses",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false),
+ Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OrderStatuses", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ShippingStatuses",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false),
+ Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ShippingStatuses", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetRoleClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ RoleId = table.Column(type: "nvarchar(450)", nullable: false),
+ ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
+ ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Addresses",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
+ UserId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false),
+ AddressType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ Street = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
+ City = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ State = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ PostalCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false),
+ Country = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ IsDefault = table.Column(type: "bit", nullable: false, defaultValue: false),
+ IsActive = table.Column(type: "bit", nullable: false, defaultValue: true),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
+ CreatedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false),
+ ModifiedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Addresses", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Addresses_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ UserId = table.Column(type: "nvarchar(450)", nullable: false),
+ ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
+ ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetUserClaims_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserLogins",
+ columns: table => new
+ {
+ LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
+ ProviderKey = table.Column(type: "nvarchar(450)", nullable: false),
+ ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true),
+ UserId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
+ table.ForeignKey(
+ name: "FK_AspNetUserLogins_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserRoles",
+ columns: table => new
+ {
+ UserId = table.Column(type: "nvarchar(450)", nullable: false),
+ RoleId = table.Column(type: "nvarchar(450)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserTokens",
+ columns: table => new
+ {
+ UserId = table.Column(type: "nvarchar(450)", nullable: false),
+ LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
+ Name = table.Column(type: "nvarchar(450)", nullable: false),
+ Value = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
+ table.ForeignKey(
+ name: "FK_AspNetUserTokens_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Products",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
+ Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
+ Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
+ BasePrice = table.Column(type: "decimal(18,2)", nullable: false),
+ IsCustomizable = table.Column(type: "bit", nullable: false, defaultValue: false),
+ IsActive = table.Column(type: "bit", nullable: false, defaultValue: true),
+ ImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true),
+ CategoryId = table.Column(type: "uniqueidentifier", nullable: true),
+ CreatedAt = table.Column(type: "datetime2", nullable: true),
+ ModifiedAt = table.Column(type: "datetime2", nullable: true, defaultValueSql: "GETUTCDATE()"),
+ CreatedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
+ ModifiedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Products", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Products_Categories_CategoryId",
+ column: x => x.CategoryId,
+ principalTable: "Categories",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.SetNull);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Orders",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
+ UserId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false),
+ OrderDate = table.Column(type: "datetime2", nullable: false),
+ TotalPrice = table.Column(type: "decimal(18,2)", nullable: false),
+ OrderStatusId = table.Column(type: "int", nullable: false),
+ ShippingStatusId = table.Column(type: "int", nullable: false),
+ OrderNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
+ CreatedAt = table.Column(type: "datetime2", nullable: false),
+ ModifiedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()"),
+ CreatedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false),
+ ModifiedBy = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Orders", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Orders_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Orders_OrderStatuses_OrderStatusId",
+ column: x => x.OrderStatusId,
+ principalTable: "OrderStatuses",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Orders_ShippingStatuses_ShippingStatusId",
+ column: x => x.ShippingStatusId,
+ principalTable: "ShippingStatuses",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ProductVariants",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
+ ProductId = table.Column(type: "uniqueidentifier", nullable: false),
+ Size = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ Color = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
+ Price = table.Column(type: "decimal(18,2)", nullable: false),
+ ImageUrl = table.Column