//
using System;
using Diligent.WebAPI.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Diligent.WebAPI.Data.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20220331142133_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.InsuranceCompany", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("City")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Country")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CreatedAtUtc")
.HasColumnType("datetime2");
b.Property("DeletedAtUtc")
.HasColumnType("datetime2");
b.Property("Fax")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("LegalAddress")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("LegalEmail")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PostalCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UpdatedAtUtc")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("InsuranceCompanies");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.InsurancePolicy", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CreatedAtUtc")
.HasColumnType("datetime2");
b.Property("DeletedAtUtc")
.HasColumnType("datetime2");
b.Property("EndDate")
.HasColumnType("datetime2");
b.Property("InsurerId")
.HasColumnType("bigint");
b.Property("Premium")
.HasColumnType("decimal(18,2)");
b.Property("StartDate")
.HasColumnType("datetime2");
b.Property("Type")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UpdatedAtUtc")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("InsurerId");
b.ToTable("InsurancePolicies");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.Insurer", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("Address")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("City")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Country")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CreatedAtUtc")
.HasColumnType("datetime2");
b.Property("DateOfBirth")
.HasColumnType("datetime2");
b.Property("DeletedAtUtc")
.HasColumnType("datetime2");
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("InsuranceCompanyId")
.HasColumnType("bigint");
b.Property("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("PostalCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UpdatedAtUtc")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("InsuranceCompanyId");
b.ToTable("Insurers");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.InsurancePolicy", b =>
{
b.HasOne("Diligent.WebAPI.Data.Entities.Insurer", "Insurer")
.WithMany()
.HasForeignKey("InsurerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Insurer");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.Insurer", b =>
{
b.HasOne("Diligent.WebAPI.Data.Entities.InsuranceCompany", "InsuranceCompany")
.WithMany()
.HasForeignKey("InsuranceCompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InsuranceCompany");
});
#pragma warning restore 612, 618
}
}
}