//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ToDoApp.Context;
#nullable disable
namespace ToDoApp.Migrations
{
[DbContext(typeof(ToDoContext))]
[Migration("20231027075930_init")]
partial class init
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.13")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("ToDoApp.Model.Item", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("CreateDate")
.HasColumnType("datetime(6)");
b.Property("Description")
.HasColumnType("longtext");
b.Property("DueDate")
.HasColumnType("datetime(6)");
b.Property("IsCompleted")
.HasColumnType("tinyint(1)");
b.Property("IsToday")
.HasColumnType("tinyint(1)");
b.Property("Title")
.IsRequired()
.HasColumnType("longtext");
b.Property("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Items");
});
modelBuilder.Entity("ToDoApp.Model.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("CreateDate")
.HasColumnType("datetime(6)");
b.Property("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property("Name")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("ToDoApp.Model.Item", b =>
{
b.HasOne("ToDoApp.Model.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
#pragma warning restore 612, 618
}
}
}