diff --git a/Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.Designer.cs b/Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.Designer.cs similarity index 98% rename from Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.Designer.cs rename to Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.Designer.cs index 705a8da..26396b8 100644 --- a/Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.Designer.cs +++ b/Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.Designer.cs @@ -12,7 +12,7 @@ using Webshop.Infrastructure.Data; namespace Webshop.Infrastructure.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250725140508_InitalCreate")] + [Migration("20250729124654_InitalCreate")] partial class InitalCreate { /// @@ -219,76 +219,6 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("Addresses"); }); - modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LastActive") - .HasColumnType("timestamp with time zone"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("Users", (string)null); - }); - modelBuilder.Entity("Webshop.Domain.Entities.Category", b => { b.Property("Id") @@ -357,6 +287,12 @@ namespace Webshop.Infrastructure.Migrations .IsRequired() .HasColumnType("text"); + b.Property("DefaultBillingAddressId") + .HasColumnType("uuid"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("uuid"); + b.Property("FirstName") .IsRequired() .HasMaxLength(100) @@ -924,6 +860,76 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("Suppliers"); }); + modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("CreatedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("LastActive") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("Users", (string)null); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) @@ -935,7 +941,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -944,7 +950,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -959,7 +965,7 @@ namespace Webshop.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -968,7 +974,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1015,7 +1021,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Webshop.Domain.Entities.Customer", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", "User") + b.HasOne("Webshop.Domain.Identity.ApplicationUser", "User") .WithOne("Customer") .HasForeignKey("Webshop.Domain.Entities.Customer", "AspNetUserId") .OnDelete(DeleteBehavior.Cascade) @@ -1170,12 +1176,6 @@ namespace Webshop.Infrastructure.Migrations b.Navigation("Address"); }); - modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b => - { - b.Navigation("Customer") - .IsRequired(); - }); - modelBuilder.Entity("Webshop.Domain.Entities.Category", b => { b.Navigation("CategoryDiscounts"); @@ -1221,6 +1221,11 @@ namespace Webshop.Infrastructure.Migrations { b.Navigation("Products"); }); + + modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b => + { + b.Navigation("Customer"); + }); #pragma warning restore 612, 618 } } diff --git a/Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.cs b/Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.cs similarity index 99% rename from Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.cs rename to Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.cs index 34f5517..f66c625 100644 --- a/Webshop.Infrastructure/Migrations/20250725140508_InitalCreate.cs +++ b/Webshop.Infrastructure/Migrations/20250729124654_InitalCreate.cs @@ -202,7 +202,9 @@ namespace Webshop.Infrastructure.Migrations Id = table.Column(type: "uuid", nullable: false), AspNetUserId = table.Column(type: "text", nullable: false), FirstName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - LastName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false) + LastName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + DefaultShippingAddressId = table.Column(type: "uuid", nullable: true), + DefaultBillingAddressId = table.Column(type: "uuid", nullable: true) }, constraints: table => { diff --git a/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs b/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs index 23a260a..51deea3 100644 --- a/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Webshop.Infrastructure/Migrations/ApplicationDbContextModelSnapshot.cs @@ -216,76 +216,6 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("Addresses"); }); - modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("CreatedDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LastActive") - .HasColumnType("timestamp with time zone"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("Users", (string)null); - }); - modelBuilder.Entity("Webshop.Domain.Entities.Category", b => { b.Property("Id") @@ -354,6 +284,12 @@ namespace Webshop.Infrastructure.Migrations .IsRequired() .HasColumnType("text"); + b.Property("DefaultBillingAddressId") + .HasColumnType("uuid"); + + b.Property("DefaultShippingAddressId") + .HasColumnType("uuid"); + b.Property("FirstName") .IsRequired() .HasMaxLength(100) @@ -921,6 +857,76 @@ namespace Webshop.Infrastructure.Migrations b.ToTable("Suppliers"); }); + modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("CreatedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("LastActive") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("Users", (string)null); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) @@ -932,7 +938,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -941,7 +947,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -956,7 +962,7 @@ namespace Webshop.Infrastructure.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -965,7 +971,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", null) + b.HasOne("Webshop.Domain.Identity.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1012,7 +1018,7 @@ namespace Webshop.Infrastructure.Migrations modelBuilder.Entity("Webshop.Domain.Entities.Customer", b => { - b.HasOne("Webshop.Domain.Entities.ApplicationUser", "User") + b.HasOne("Webshop.Domain.Identity.ApplicationUser", "User") .WithOne("Customer") .HasForeignKey("Webshop.Domain.Entities.Customer", "AspNetUserId") .OnDelete(DeleteBehavior.Cascade) @@ -1167,12 +1173,6 @@ namespace Webshop.Infrastructure.Migrations b.Navigation("Address"); }); - modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b => - { - b.Navigation("Customer") - .IsRequired(); - }); - modelBuilder.Entity("Webshop.Domain.Entities.Category", b => { b.Navigation("CategoryDiscounts"); @@ -1218,6 +1218,11 @@ namespace Webshop.Infrastructure.Migrations { b.Navigation("Products"); }); + + modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b => + { + b.Navigation("Customer"); + }); #pragma warning restore 612, 618 } }