|
|
|
@@ -0,0 +1,996 @@ |
|
|
|
// <auto-generated /> |
|
|
|
using System; |
|
|
|
using CartWise.Infrastructure.Data; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
|
|
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|
|
|
|
|
|
|
#nullable disable |
|
|
|
|
|
|
|
namespace CartWise.Infrastructure.Data.Migrations |
|
|
|
{ |
|
|
|
[DbContext(typeof(CartWiseDbContext))] |
|
|
|
[Migration("20260810191555_AddPurchases")] |
|
|
|
partial class AddPurchases |
|
|
|
{ |
|
|
|
/// <inheritdoc /> |
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|
|
|
{ |
|
|
|
#pragma warning disable 612, 618 |
|
|
|
modelBuilder.HasAnnotation("ProductVersion", "10.0.10"); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Brand", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("BrandId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedName") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("BrandId"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedName") |
|
|
|
.IsUnique(); |
|
|
|
|
|
|
|
b.ToTable("Brands"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.GroceryConcept", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("GroceryConceptId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("CategoryId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedName") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("GroceryConceptId"); |
|
|
|
|
|
|
|
b.HasIndex("CategoryId"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedName") |
|
|
|
.IsUnique(); |
|
|
|
|
|
|
|
b.ToTable("GroceryConcepts"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Household", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("HouseholdId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("CreatedByUserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(120) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("HouseholdId"); |
|
|
|
|
|
|
|
b.HasIndex("CreatedByUserId"); |
|
|
|
|
|
|
|
b.ToTable("Households"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.HouseholdMember", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("HouseholdId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("UserId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("JoinedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("Role") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.HasKey("HouseholdId", "UserId"); |
|
|
|
|
|
|
|
b.HasIndex("UserId"); |
|
|
|
|
|
|
|
b.ToTable("HouseholdMembers"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.HouseholdProductPreference", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("HouseholdProductPreferenceId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("GroceryConceptId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("HouseholdId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("PreferredProductId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("PreferredQuantity") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("PreferredUnit") |
|
|
|
.HasMaxLength(32) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("SubstitutionLevel") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("HouseholdProductPreferenceId"); |
|
|
|
|
|
|
|
b.HasIndex("GroceryConceptId"); |
|
|
|
|
|
|
|
b.HasIndex("PreferredProductId"); |
|
|
|
|
|
|
|
b.HasIndex("HouseholdId", "GroceryConceptId") |
|
|
|
.IsUnique(); |
|
|
|
|
|
|
|
b.ToTable("HouseholdProductPreferences"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Product", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("ProductId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("BrandId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("GroceryConceptId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ImageUrl") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(240) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedName") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(240) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("SizeUnit") |
|
|
|
.HasMaxLength(32) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("SizeValue") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("SourceExternalId") |
|
|
|
.HasMaxLength(200) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("SourceType") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("ProductId"); |
|
|
|
|
|
|
|
b.HasIndex("BrandId"); |
|
|
|
|
|
|
|
b.HasIndex("GroceryConceptId"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedName"); |
|
|
|
|
|
|
|
b.ToTable("Products"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ProductCategory", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("ProductCategoryId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("ParentCategoryId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("ProductCategoryId"); |
|
|
|
|
|
|
|
b.HasIndex("ParentCategoryId"); |
|
|
|
|
|
|
|
b.ToTable("ProductCategories"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ProductIdentifier", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("ProductIdentifierId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("IdentifierType") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedValue") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(64) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("ProductId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Value") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(64) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("ProductIdentifierId"); |
|
|
|
|
|
|
|
b.HasIndex("ProductId"); |
|
|
|
|
|
|
|
b.HasIndex("IdentifierType", "NormalizedValue") |
|
|
|
.IsUnique(); |
|
|
|
|
|
|
|
b.ToTable("ProductIdentifiers"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Purchase", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("PurchaseId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("HouseholdId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("PurchasedByUserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("PurchasedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("SourceType") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<Guid?>("StoreLocationId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Subtotal") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Tax") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Total") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("PurchaseId"); |
|
|
|
|
|
|
|
b.HasIndex("PurchasedByUserId"); |
|
|
|
|
|
|
|
b.HasIndex("StoreLocationId"); |
|
|
|
|
|
|
|
b.HasIndex("HouseholdId", "PurchasedUtc"); |
|
|
|
|
|
|
|
b.ToTable("Purchases"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.PurchaseItem", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("PurchaseItemId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Description") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(240) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("GroceryConceptId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal>("LinePrice") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("ProductId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("PurchaseId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal>("Quantity") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("ShoppingListItemId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Unit") |
|
|
|
.HasMaxLength(32) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("UnitPrice") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("PurchaseItemId"); |
|
|
|
|
|
|
|
b.HasIndex("GroceryConceptId"); |
|
|
|
|
|
|
|
b.HasIndex("ProductId"); |
|
|
|
|
|
|
|
b.HasIndex("PurchaseId"); |
|
|
|
|
|
|
|
b.HasIndex("ShoppingListItemId"); |
|
|
|
|
|
|
|
b.ToTable("PurchaseItems"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Retailer", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("RetailerId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedName") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("WebsiteUrl") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("RetailerId"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedName") |
|
|
|
.IsUnique(); |
|
|
|
|
|
|
|
b.ToTable("Retailers"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ShoppingList", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("ShoppingListId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime?>("CompletedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("CreatedByUserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("HouseholdId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(160) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("Status") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.HasKey("ShoppingListId"); |
|
|
|
|
|
|
|
b.HasIndex("CreatedByUserId"); |
|
|
|
|
|
|
|
b.HasIndex("HouseholdId", "Status"); |
|
|
|
|
|
|
|
b.ToTable("ShoppingLists"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ShoppingListItem", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("ShoppingListItemId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("AddedByUserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("AddedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("DisplayName") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(240) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid?>("GroceryConceptId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Notes") |
|
|
|
.HasMaxLength(500) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime?>("PurchasedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Quantity") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("RowVersion") |
|
|
|
.IsConcurrencyToken() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("ShoppingListId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("SortOrder") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<int>("Status") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("Unit") |
|
|
|
.HasMaxLength(32) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("ShoppingListItemId"); |
|
|
|
|
|
|
|
b.HasIndex("AddedByUserId"); |
|
|
|
|
|
|
|
b.HasIndex("GroceryConceptId"); |
|
|
|
|
|
|
|
b.HasIndex("ShoppingListId", "Status"); |
|
|
|
|
|
|
|
b.ToTable("ShoppingListItems"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.StoreLocation", b => |
|
|
|
{ |
|
|
|
b.Property<Guid>("StoreLocationId") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("AddressLine1") |
|
|
|
.HasMaxLength(200) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("AddressLine2") |
|
|
|
.HasMaxLength(200) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("City") |
|
|
|
.HasMaxLength(120) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("CountryCode") |
|
|
|
.HasMaxLength(2) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ExternalStoreId") |
|
|
|
.HasMaxLength(120) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Latitude") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<decimal?>("Longitude") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.IsRequired() |
|
|
|
.HasMaxLength(200) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("PostalCode") |
|
|
|
.HasMaxLength(24) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Region") |
|
|
|
.HasMaxLength(80) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<Guid>("RetailerId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("StoreLocationId"); |
|
|
|
|
|
|
|
b.HasIndex("RetailerId"); |
|
|
|
|
|
|
|
b.ToTable("StoreLocations"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Infrastructure.Identity.ApplicationUser", b => |
|
|
|
{ |
|
|
|
b.Property<string>("Id") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<int>("AccessFailedCount") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("ConcurrencyStamp") |
|
|
|
.IsConcurrencyToken() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedUtc") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("DisplayName") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Email") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<bool>("EmailConfirmed") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<bool>("LockoutEnabled") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedEmail") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedUserName") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("PasswordHash") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("PhoneNumber") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("SecurityStamp") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<bool>("TwoFactorEnabled") |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("UserName") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("Id"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedEmail") |
|
|
|
.HasDatabaseName("EmailIndex"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedUserName") |
|
|
|
.IsUnique() |
|
|
|
.HasDatabaseName("UserNameIndex"); |
|
|
|
|
|
|
|
b.ToTable("AspNetUsers", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => |
|
|
|
{ |
|
|
|
b.Property<string>("Id") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ConcurrencyStamp") |
|
|
|
.IsConcurrencyToken() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("NormalizedName") |
|
|
|
.HasMaxLength(256) |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("Id"); |
|
|
|
|
|
|
|
b.HasIndex("NormalizedName") |
|
|
|
.IsUnique() |
|
|
|
.HasDatabaseName("RoleNameIndex"); |
|
|
|
|
|
|
|
b.ToTable("AspNetRoles", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => |
|
|
|
{ |
|
|
|
b.Property<int>("Id") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("ClaimType") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ClaimValue") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("RoleId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("Id"); |
|
|
|
|
|
|
|
b.HasIndex("RoleId"); |
|
|
|
|
|
|
|
b.ToTable("AspNetRoleClaims", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => |
|
|
|
{ |
|
|
|
b.Property<int>("Id") |
|
|
|
.ValueGeneratedOnAdd() |
|
|
|
.HasColumnType("INTEGER"); |
|
|
|
|
|
|
|
b.Property<string>("ClaimType") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ClaimValue") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("UserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("Id"); |
|
|
|
|
|
|
|
b.HasIndex("UserId"); |
|
|
|
|
|
|
|
b.ToTable("AspNetUserClaims", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => |
|
|
|
{ |
|
|
|
b.Property<string>("LoginProvider") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ProviderKey") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("ProviderDisplayName") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("UserId") |
|
|
|
.IsRequired() |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey"); |
|
|
|
|
|
|
|
b.HasIndex("UserId"); |
|
|
|
|
|
|
|
b.ToTable("AspNetUserLogins", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => |
|
|
|
{ |
|
|
|
b.Property<string>("UserId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("RoleId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("UserId", "RoleId"); |
|
|
|
|
|
|
|
b.HasIndex("RoleId"); |
|
|
|
|
|
|
|
b.ToTable("AspNetUserRoles", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => |
|
|
|
{ |
|
|
|
b.Property<string>("UserId") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("LoginProvider") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Name") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.Property<string>("Value") |
|
|
|
.HasColumnType("TEXT"); |
|
|
|
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name"); |
|
|
|
|
|
|
|
b.ToTable("AspNetUserTokens", (string)null); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.GroceryConcept", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.ProductCategory", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("CategoryId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Household", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("CreatedByUserId") |
|
|
|
.OnDelete(DeleteBehavior.Restrict) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.HouseholdMember", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.Household", null) |
|
|
|
.WithMany("Members") |
|
|
|
.HasForeignKey("HouseholdId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("UserId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.HouseholdProductPreference", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.GroceryConcept", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("GroceryConceptId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.Household", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("HouseholdId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.Product", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("PreferredProductId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Product", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.Brand", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("BrandId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.GroceryConcept", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("GroceryConceptId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ProductCategory", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.ProductCategory", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("ParentCategoryId") |
|
|
|
.OnDelete(DeleteBehavior.Restrict); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ProductIdentifier", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.Product", null) |
|
|
|
.WithMany("Identifiers") |
|
|
|
.HasForeignKey("ProductId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Purchase", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.Household", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("HouseholdId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("PurchasedByUserId") |
|
|
|
.OnDelete(DeleteBehavior.Restrict) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.StoreLocation", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("StoreLocationId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.PurchaseItem", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.GroceryConcept", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("GroceryConceptId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.Product", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("ProductId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.Purchase", null) |
|
|
|
.WithMany("Items") |
|
|
|
.HasForeignKey("PurchaseId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.ShoppingListItem", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("ShoppingListItemId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ShoppingList", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("CreatedByUserId") |
|
|
|
.OnDelete(DeleteBehavior.Restrict) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.Household", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("HouseholdId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ShoppingListItem", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("AddedByUserId") |
|
|
|
.OnDelete(DeleteBehavior.Restrict) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.GroceryConcept", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("GroceryConceptId") |
|
|
|
.OnDelete(DeleteBehavior.SetNull); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Domain.Entities.ShoppingList", null) |
|
|
|
.WithMany("Items") |
|
|
|
.HasForeignKey("ShoppingListId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.StoreLocation", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Domain.Entities.Retailer", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("RetailerId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => |
|
|
|
{ |
|
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("RoleId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("UserId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("UserId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => |
|
|
|
{ |
|
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("RoleId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
|
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("UserId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => |
|
|
|
{ |
|
|
|
b.HasOne("CartWise.Infrastructure.Identity.ApplicationUser", null) |
|
|
|
.WithMany() |
|
|
|
.HasForeignKey("UserId") |
|
|
|
.OnDelete(DeleteBehavior.Cascade) |
|
|
|
.IsRequired(); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Household", b => |
|
|
|
{ |
|
|
|
b.Navigation("Members"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Product", b => |
|
|
|
{ |
|
|
|
b.Navigation("Identifiers"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.Purchase", b => |
|
|
|
{ |
|
|
|
b.Navigation("Items"); |
|
|
|
}); |
|
|
|
|
|
|
|
modelBuilder.Entity("CartWise.Domain.Entities.ShoppingList", b => |
|
|
|
{ |
|
|
|
b.Navigation("Items"); |
|
|
|
}); |
|
|
|
#pragma warning restore 612, 618 |
|
|
|
} |
|
|
|
} |
|
|
|
} |