migration

This commit is contained in:
Tizian.Breuch
2025-07-29 14:47:57 +02:00
parent deab93855e
commit 773bd1a1fe
3 changed files with 176 additions and 164 deletions

View File

@@ -12,7 +12,7 @@ using Webshop.Infrastructure.Data;
namespace Webshop.Infrastructure.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20250725140508_InitalCreate")]
[Migration("20250729124654_InitalCreate")]
partial class InitalCreate
{
/// <inheritdoc />
@@ -219,76 +219,6 @@ namespace Webshop.Infrastructure.Migrations
b.ToTable("Addresses");
});
modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastActive")
.HasColumnType("timestamp with time zone");
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("Users", (string)null);
});
modelBuilder.Entity("Webshop.Domain.Entities.Category", b =>
{
b.Property<Guid>("Id")
@@ -357,6 +287,12 @@ namespace Webshop.Infrastructure.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<Guid?>("DefaultBillingAddressId")
.HasColumnType("uuid");
b.Property<Guid?>("DefaultShippingAddressId")
.HasColumnType("uuid");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(100)
@@ -924,6 +860,76 @@ namespace Webshop.Infrastructure.Migrations
b.ToTable("Suppliers");
});
modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastActive")
.HasColumnType("timestamp with time zone");
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("Users", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
@@ -935,7 +941,7 @@ namespace Webshop.Infrastructure.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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<string>", 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<string>", 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
}
}

View File

@@ -202,7 +202,9 @@ namespace Webshop.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
AspNetUserId = table.Column<string>(type: "text", nullable: false),
FirstName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
LastName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false)
LastName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
DefaultShippingAddressId = table.Column<Guid>(type: "uuid", nullable: true),
DefaultBillingAddressId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{

View File

@@ -216,76 +216,6 @@ namespace Webshop.Infrastructure.Migrations
b.ToTable("Addresses");
});
modelBuilder.Entity("Webshop.Domain.Entities.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastActive")
.HasColumnType("timestamp with time zone");
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("Users", (string)null);
});
modelBuilder.Entity("Webshop.Domain.Entities.Category", b =>
{
b.Property<Guid>("Id")
@@ -354,6 +284,12 @@ namespace Webshop.Infrastructure.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<Guid?>("DefaultBillingAddressId")
.HasColumnType("uuid");
b.Property<Guid?>("DefaultShippingAddressId")
.HasColumnType("uuid");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(100)
@@ -921,6 +857,76 @@ namespace Webshop.Infrastructure.Migrations
b.ToTable("Suppliers");
});
modelBuilder.Entity("Webshop.Domain.Identity.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LastActive")
.HasColumnType("timestamp with time zone");
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("Users", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
@@ -932,7 +938,7 @@ namespace Webshop.Infrastructure.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", 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<string>", 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<string>", 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
}
}