//
using System;
using Diligent.WebAPI.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Diligent.WebAPI.Data.Migrations
{
[DbContext(typeof(DatabaseContext))]
partial class DatabaseContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(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.WebhookDefinition", 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("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property("UpdatedAtUtc")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("WebhookDefinitions");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.WebhookSubscription", 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("IsActive")
.HasColumnType("bit");
b.Property("UpdatedAtUtc")
.HasColumnType("datetime2");
b.Property("WebhookDefinitionId")
.HasColumnType("bigint");
b.Property("WebhookURL")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("WebhookDefinitionId");
b.ToTable("WebhookSubscriptions");
});
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");
});
modelBuilder.Entity("Diligent.WebAPI.Data.Entities.WebhookSubscription", b =>
{
b.HasOne("Diligent.WebAPI.Data.Entities.WebhookDefinition", "WebhookDefinition")
.WithMany()
.HasForeignKey("WebhookDefinitionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("WebhookDefinition");
});
#pragma warning restore 612, 618
}
}
}