Spaces:
Sleeping
Sleeping
| // <auto-generated /> | |
| using System; | |
| using ECommerce.Model.Data; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.EntityFrameworkCore.Infrastructure; | |
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | |
| using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; | |
| namespace ECommerce.Model.Migrations | |
| { | |
| [] | |
| partial class AppDbContextModelSnapshot : ModelSnapshot | |
| { | |
| protected override void BuildModel(ModelBuilder modelBuilder) | |
| { | |
| modelBuilder | |
| .HasAnnotation("ProductVersion", "10.0.0-preview.3.25171.6") | |
| .HasAnnotation("Relational:MaxIdentifierLength", 63); | |
| NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Cart", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<Guid>("CustomerId") | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.HasKey("Id"); | |
| b.HasIndex("CustomerId") | |
| .IsUnique(); | |
| b.ToTable("Carts"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.CartItem", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<Guid>("CartId") | |
| .HasColumnType("uuid"); | |
| b.Property<Guid>("ProductId") | |
| .HasColumnType("uuid"); | |
| b.Property<int>("Quantity") | |
| .HasColumnType("integer"); | |
| b.HasKey("Id"); | |
| b.HasIndex("CartId"); | |
| b.HasIndex("ProductId"); | |
| b.ToTable("CartItems"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Category", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("Description") | |
| .HasColumnType("text"); | |
| b.Property<string>("ImageUrl") | |
| .HasColumnType("text"); | |
| b.Property<string>("Name") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.HasKey("Id"); | |
| b.ToTable("Categories"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Customer", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("FirstName") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<string>("LastName") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<string>("Phone") | |
| .HasColumnType("text"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("UserId") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.HasKey("Id"); | |
| b.ToTable("Customers"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Order", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<Guid>("CustomerId") | |
| .HasColumnType("uuid"); | |
| b.Property<string>("OrderNumber") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<string>("Status") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<decimal>("TotalAmount") | |
| .HasPrecision(18, 2) | |
| .HasColumnType("numeric(18,2)"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.HasKey("Id"); | |
| b.HasIndex("CustomerId"); | |
| b.ToTable("Orders"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.OrderItem", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<Guid>("OrderId") | |
| .HasColumnType("uuid"); | |
| b.Property<Guid>("ProductId") | |
| .HasColumnType("uuid"); | |
| b.Property<int>("Quantity") | |
| .HasColumnType("integer"); | |
| b.Property<decimal>("UnitPrice") | |
| .HasPrecision(18, 2) | |
| .HasColumnType("numeric(18,2)"); | |
| b.HasKey("Id"); | |
| b.HasIndex("OrderId"); | |
| b.HasIndex("ProductId"); | |
| b.ToTable("OrderItems"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Payment", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<decimal>("Amount") | |
| .HasPrecision(18, 2) | |
| .HasColumnType("numeric(18,2)"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("Currency") | |
| .HasColumnType("text"); | |
| b.Property<Guid>("OrderId") | |
| .HasColumnType("uuid"); | |
| b.Property<string>("Status") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<string>("StripePaymentIntentId") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.HasKey("Id"); | |
| b.HasIndex("OrderId") | |
| .IsUnique(); | |
| b.ToTable("Payments"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Product", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<Guid>("CategoryId") | |
| .HasColumnType("uuid"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("Description") | |
| .HasColumnType("text"); | |
| b.Property<string>("ImageContentType") | |
| .HasColumnType("text"); | |
| b.Property<byte[]>("ImageData") | |
| .HasColumnType("bytea"); | |
| b.Property<string>("ImageUrl") | |
| .HasColumnType("text"); | |
| b.Property<string>("Name") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b.Property<decimal>("Price") | |
| .HasPrecision(18, 2) | |
| .HasColumnType("numeric(18,2)"); | |
| b.Property<int>("StockQuantity") | |
| .HasColumnType("integer"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.HasKey("Id"); | |
| b.HasIndex("CategoryId"); | |
| b.ToTable("Products"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Review", b => | |
| { | |
| b.Property<Guid>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("uuid"); | |
| b.Property<string>("Comment") | |
| .HasMaxLength(1000) | |
| .HasColumnType("character varying(1000)"); | |
| b.Property<DateTime>("CreatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<Guid>("ProductId") | |
| .HasColumnType("uuid"); | |
| b.Property<int>("Rating") | |
| .HasColumnType("integer"); | |
| b.Property<DateTime?>("UpdatedAt") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("UserId") | |
| .HasColumnType("text"); | |
| b.Property<string>("UserName") | |
| .IsRequired() | |
| .HasMaxLength(100) | |
| .HasColumnType("character varying(100)"); | |
| b.HasKey("Id"); | |
| b.HasIndex("ProductId"); | |
| b.ToTable("Reviews"); | |
| }); | |
| 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("character varying(256)"); | |
| b.Property<string>("NormalizedName") | |
| .HasMaxLength(256) | |
| .HasColumnType("character varying(256)"); | |
| 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"); | |
| NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); | |
| 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.IdentityUser", b => | |
| { | |
| b.Property<string>("Id") | |
| .HasColumnType("text"); | |
| b.Property<int>("AccessFailedCount") | |
| .HasColumnType("integer"); | |
| b.Property<string>("ConcurrencyStamp") | |
| .IsConcurrencyToken() | |
| .HasColumnType("text"); | |
| b.Property<string>("Email") | |
| .HasMaxLength(256) | |
| .HasColumnType("character varying(256)"); | |
| b.Property<bool>("EmailConfirmed") | |
| .HasColumnType("boolean"); | |
| b.Property<bool>("LockoutEnabled") | |
| .HasColumnType("boolean"); | |
| b.Property<DateTimeOffset?>("LockoutEnd") | |
| .HasColumnType("timestamp with time zone"); | |
| b.Property<string>("NormalizedEmail") | |
| .HasMaxLength(256) | |
| .HasColumnType("character varying(256)"); | |
| b.Property<string>("NormalizedUserName") | |
| .HasMaxLength(256) | |
| .HasColumnType("character varying(256)"); | |
| b.Property<string>("PasswordHash") | |
| .HasColumnType("text"); | |
| b.Property<string>("PhoneNumber") | |
| .HasColumnType("text"); | |
| b.Property<bool>("PhoneNumberConfirmed") | |
| .HasColumnType("boolean"); | |
| b.Property<string>("SecurityStamp") | |
| .HasColumnType("text"); | |
| b.Property<bool>("TwoFactorEnabled") | |
| .HasColumnType("boolean"); | |
| b.Property<string>("UserName") | |
| .HasMaxLength(256) | |
| .HasColumnType("character varying(256)"); | |
| b.HasKey("Id"); | |
| b.HasIndex("NormalizedEmail") | |
| .HasDatabaseName("EmailIndex"); | |
| b.HasIndex("NormalizedUserName") | |
| .IsUnique() | |
| .HasDatabaseName("UserNameIndex"); | |
| b.ToTable("AspNetUsers", (string)null); | |
| }); | |
| modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => | |
| { | |
| b.Property<int>("Id") | |
| .ValueGeneratedOnAdd() | |
| .HasColumnType("integer"); | |
| NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); | |
| 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("ECommerce.Model.Entities.Cart", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Customer", "Customer") | |
| .WithOne("Cart") | |
| .HasForeignKey("ECommerce.Model.Entities.Cart", "CustomerId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Customer"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.CartItem", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Cart", "Cart") | |
| .WithMany("Items") | |
| .HasForeignKey("CartId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.HasOne("ECommerce.Model.Entities.Product", "Product") | |
| .WithMany() | |
| .HasForeignKey("ProductId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Cart"); | |
| b.Navigation("Product"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Customer", b => | |
| { | |
| b.OwnsOne("ECommerce.Model.ValueObjects.Address", "DefaultAddress", b1 => | |
| { | |
| b1.Property<Guid>("CustomerId") | |
| .HasColumnType("uuid"); | |
| b1.Property<string>("City") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("Country") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("State") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("Street") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("ZipCode") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.HasKey("CustomerId"); | |
| b1.ToTable("Customers"); | |
| b1.WithOwner() | |
| .HasForeignKey("CustomerId"); | |
| }); | |
| b.Navigation("DefaultAddress"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Order", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Customer", "Customer") | |
| .WithMany("Orders") | |
| .HasForeignKey("CustomerId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.OwnsOne("ECommerce.Model.ValueObjects.Address", "ShippingAddress", b1 => | |
| { | |
| b1.Property<Guid>("OrderId") | |
| .HasColumnType("uuid"); | |
| b1.Property<string>("City") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("Country") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("State") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("Street") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.Property<string>("ZipCode") | |
| .IsRequired() | |
| .HasColumnType("text"); | |
| b1.HasKey("OrderId"); | |
| b1.ToTable("Orders"); | |
| b1.WithOwner() | |
| .HasForeignKey("OrderId"); | |
| }); | |
| b.Navigation("Customer"); | |
| b.Navigation("ShippingAddress"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.OrderItem", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Order", "Order") | |
| .WithMany("Items") | |
| .HasForeignKey("OrderId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.HasOne("ECommerce.Model.Entities.Product", "Product") | |
| .WithMany() | |
| .HasForeignKey("ProductId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Order"); | |
| b.Navigation("Product"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Payment", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Order", "Order") | |
| .WithOne("Payment") | |
| .HasForeignKey("ECommerce.Model.Entities.Payment", "OrderId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Order"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Product", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Category", "Category") | |
| .WithMany("Products") | |
| .HasForeignKey("CategoryId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Category"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Review", b => | |
| { | |
| b.HasOne("ECommerce.Model.Entities.Product", "Product") | |
| .WithMany() | |
| .HasForeignKey("ProductId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| b.Navigation("Product"); | |
| }); | |
| 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("Microsoft.AspNetCore.Identity.IdentityUser", null) | |
| .WithMany() | |
| .HasForeignKey("UserId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| }); | |
| modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => | |
| { | |
| b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", 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("Microsoft.AspNetCore.Identity.IdentityUser", null) | |
| .WithMany() | |
| .HasForeignKey("UserId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| }); | |
| modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => | |
| { | |
| b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) | |
| .WithMany() | |
| .HasForeignKey("UserId") | |
| .OnDelete(DeleteBehavior.Cascade) | |
| .IsRequired(); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Cart", b => | |
| { | |
| b.Navigation("Items"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Category", b => | |
| { | |
| b.Navigation("Products"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Customer", b => | |
| { | |
| b.Navigation("Cart"); | |
| b.Navigation("Orders"); | |
| }); | |
| modelBuilder.Entity("ECommerce.Model.Entities.Order", b => | |
| { | |
| b.Navigation("Items"); | |
| b.Navigation("Payment"); | |
| }); | |
| } | |
| } | |
| } | |