135 lines
4.6 KiB
C#
135 lines
4.6 KiB
C#
|
// <auto-generated />
|
|||
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
|
using Weifer.Database.EF;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace Weifer.Database.EF.Migrations
|
|||
|
{
|
|||
|
[DbContext(typeof(DatabaseContext))]
|
|||
|
[Migration("20240223223336_init")]
|
|||
|
partial class init
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|||
|
{
|
|||
|
#pragma warning disable 612, 618
|
|||
|
modelBuilder
|
|||
|
.HasAnnotation("ProductVersion", "8.0.2")
|
|||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|||
|
|
|||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.Customer", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("CustomerId")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("uniqueidentifier");
|
|||
|
|
|||
|
b.Property<DateTime>("CreatedOn")
|
|||
|
.HasColumnType("datetime2");
|
|||
|
|
|||
|
b.Property<string>("Email")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("FirstName")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("LastName")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("PasswordHash")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.HasKey("CustomerId");
|
|||
|
|
|||
|
b.ToTable("Customers");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.ShoppingItem", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("ShoppingItemId")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("uniqueidentifier");
|
|||
|
|
|||
|
b.Property<string>("Description")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<int>("Number")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<bool>("Purchased")
|
|||
|
.HasColumnType("bit");
|
|||
|
|
|||
|
b.Property<Guid>("ShoppingListId")
|
|||
|
.HasColumnType("uniqueidentifier");
|
|||
|
|
|||
|
b.HasKey("ShoppingItemId");
|
|||
|
|
|||
|
b.HasIndex("ShoppingListId");
|
|||
|
|
|||
|
b.ToTable("ShoppingItems");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.ShoppingList", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("ShoppingListId")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("uniqueidentifier");
|
|||
|
|
|||
|
b.Property<Guid>("CustomerId")
|
|||
|
.HasColumnType("uniqueidentifier");
|
|||
|
|
|||
|
b.Property<string>("ShoppingListName")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.HasKey("ShoppingListId");
|
|||
|
|
|||
|
b.HasIndex("CustomerId");
|
|||
|
|
|||
|
b.ToTable("ShoppingLists");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.ShoppingItem", b =>
|
|||
|
{
|
|||
|
b.HasOne("Weifer.Database.EF.Entitys.ShoppingList", null)
|
|||
|
.WithMany("ShoppingItems")
|
|||
|
.HasForeignKey("ShoppingListId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.ShoppingList", b =>
|
|||
|
{
|
|||
|
b.HasOne("Weifer.Database.EF.Entitys.Customer", null)
|
|||
|
.WithMany("ShoppingLists")
|
|||
|
.HasForeignKey("CustomerId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.Customer", b =>
|
|||
|
{
|
|||
|
b.Navigation("ShoppingLists");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("Weifer.Database.EF.Entitys.ShoppingList", b =>
|
|||
|
{
|
|||
|
b.Navigation("ShoppingItems");
|
|||
|
});
|
|||
|
#pragma warning restore 612, 618
|
|||
|
}
|
|||
|
}
|
|||
|
}
|