//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Repository;
#nullable disable
namespace Ultimate.Migrations
{
[DbContext(typeof(RepositoryContext))]
[Migration("20230912082832_DatabaseCreate")]
partial class DatabaseCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Entities.Company", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnName("CompanyId");
b.Property("Address")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("varchar(60)");
b.Property("Country")
.HasColumnType("longtext");
b.Property("Name")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("varchar(60)");
b.HasKey("Id");
b.ToTable("Companies");
});
modelBuilder.Entity("Entities.Employee", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnName("EmployeeId");
b.Property("Age")
.HasColumnType("int");
b.Property("CompanyId")
.HasColumnType("char(36)");
b.Property("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)");
b.Property("Position")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.HasKey("Id");
b.HasIndex("CompanyId");
b.ToTable("Employees");
});
modelBuilder.Entity("Entities.Employee", b =>
{
b.HasOne("Entities.Company", "Company")
.WithMany("Employees")
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Company");
});
modelBuilder.Entity("Entities.Company", b =>
{
b.Navigation("Employees");
});
#pragma warning restore 612, 618
}
}
}