// <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 e_suite.Database.SqlServer;

#nullable disable

namespace esuite.Database.SqlServer.Migrations
{
    [DbContext(typeof(SqlEsuiteDatabaseDbContext))]
    [Migration("20241009122056_specification foreign key")]
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
    partial class specificationforeignkey
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.10")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDetail", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("Comment")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTimeOffset>("DateTime")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("Fields")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<string>("UserDisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.ToTable("AuditDetails", "Audit");
                });

            modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDrillHierarchy", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("ChildAuditDrillDownEntityId")
                        .HasColumnType("bigint");

                    b.Property<long>("ParentAuditDrillDownEntityId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("ChildAuditDrillDownEntityId");

                    b.HasIndex("ParentAuditDrillDownEntityId");

                    b.ToTable("AuditDrillHierarchies", "Audit");
                });

            modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("AuditLogId")
                        .HasColumnType("bigint");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("EntityName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("IsPrimary")
                        .HasColumnType("bit");

                    b.Property<string>("PrimaryKey")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AuditLogId");

                    b.ToTable("AuditEntries", "Audit");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Contacts.Contact", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("JCard")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Id")
                        .IsUnique();

                    b.ToTable("Contacts", "Contacts");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomField", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("DefaultValue")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<int>("FieldType")
                        .HasColumnType("int");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long?>("MaxEntries")
                        .HasColumnType("bigint");

                    b.Property<long>("MinEntries")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("CustomFields", "CustomFields");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            DefaultValue = "",
                            Deleted = false,
                            FieldType = 7,
                            Guid = new Guid("8d910089-3079-4a29-abad-8ddf82db6dbb"),
                            MaxEntries = 1L,
                            MinEntries = 1L,
                            Name = "Print Specification Form Template"
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldFormTemplate", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<long>("FormTemplateId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.HasIndex("FormTemplateId");

                    b.ToTable("CustomFieldFormTemplates", "CustomFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldGlossary", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<long>("GlossaryId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.HasIndex("GlossaryId");

                    b.ToTable("CustomFieldGlossaries", "CustomFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldNumber", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<decimal?>("MaximumValue")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<decimal?>("MinimumValue")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.Property<decimal?>("Step")
                        .HasPrecision(28, 8)
                        .HasColumnType("decimal(28,8)");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.ToTable("CustomFieldNumbers", "CustomFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldSequence", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<long>("SequenceId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.HasIndex("SequenceId");

                    b.ToTable("CustomFieldSequences", "CustomFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldText", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<bool?>("MultiLine")
                        .HasColumnType("bit");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.ToTable("CustomFieldTexts", "CustomFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.ExceptionLog", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("Application")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ExceptionJson")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTimeOffset>("OccuredAt")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("StackTrace")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("SupportingData")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("ExceptionLogs", "Diagnostics");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.PerformanceReport", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("ActionName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ActionParameters")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ControllerName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Host")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("RequestType")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTimeOffset>("StartDateTime")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("Timings")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("TotalTimeMS")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("PerformanceReports", "Diagnostics");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.PerformanceThreshold", b =>
                {
                    b.Property<string>("ControllerName")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("ActionName")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("RequestType")
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("TotalTimeMS")
                        .HasColumnType("int");

                    b.HasKey("ControllerName", "ActionName", "RequestType");

                    b.ToTable("PerformanceThresholds", "Diagnostics");

                    b.HasData(
                        new
                        {
                            ControllerName = "",
                            ActionName = "",
                            RequestType = "",
                            TotalTimeMS = 2000
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Domain", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<long?>("SsoProviderId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.HasIndex("SsoProviderId");

                    b.ToTable("Domains", "Domain");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            Deleted = false,
                            Guid = new Guid("4eb1b0c7-e81b-4c9d-ba91-384ed47a1cf9"),
                            Name = "Sun-Strategy"
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Role", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("CanDelete")
                        .HasColumnType("bit");

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<long>("DomainId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<bool>("IsAdministrator")
                        .HasColumnType("bit");

                    b.Property<bool>("IsSuperUser")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("DomainId", "Name")
                        .IsUnique();

                    b.ToTable("Roles", "Domain");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            CanDelete = false,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("32d65817-4de4-4bd5-912e-2b33054a2171"),
                            IsAdministrator = false,
                            IsSuperUser = true,
                            Name = "Super Users"
                        },
                        new
                        {
                            Id = 2L,
                            CanDelete = false,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("2f77f57c-fe2c-4a36-ad17-5d902afc86cb"),
                            IsAdministrator = true,
                            IsSuperUser = false,
                            Name = "Administrators"
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.RoleAccess", b =>
                {
                    b.Property<long>("RoleId")
                        .HasColumnType("bigint");

                    b.Property<int>("AccessKey")
                        .HasColumnType("int");

                    b.HasKey("RoleId", "AccessKey");

                    b.ToTable("RoleAccess", "Domain");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserAccess", b =>
                {
                    b.Property<int>("AccessKey")
                        .HasColumnType("int");

                    b.Property<long>("DomainId")
                        .HasColumnType("bigint");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasIndex("DomainId");

                    b.HasIndex("UserId");

                    b.ToTable("UserAccess", "Domain");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserRole", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<long>("RoleId")
                        .HasColumnType("bigint");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasAlternateKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("UserRoles", "Domain");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            Deleted = false,
                            RoleId = 1L,
                            UserId = 1L
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormFieldInstance", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<string>("DisplayValue")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("FormInstanceId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("Index")
                        .HasColumnType("bigint");

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("CustomFieldId");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("FormInstanceId", "CustomFieldId", "Index")
                        .IsUnique();

                    b.ToTable("FormFieldInstances", "Forms");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<long>("FormTemplateVersionId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("Id");

                    b.HasIndex("FormTemplateVersionId");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.ToTable("FormInstances", "Forms");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplate", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("FormTemplates", "Forms");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<string>("FormDefinition")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("TemplateId")
                        .HasColumnType("bigint");

                    b.Property<long>("Version")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("TemplateId", "Version")
                        .IsUnique();

                    b.ToTable("FormTemplateVersions", "Forms");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<long?>("ParentId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.HasIndex("ParentId");

                    b.HasIndex("Id", "ParentId")
                        .IsUnique()
                        .HasFilter("[ParentId] IS NOT NULL");

                    b.ToTable("Glossaries", "Glossaries");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            Deleted = false,
                            Guid = new Guid("fa6566f8-b4b0-48c5-9985-336c9284796e"),
                            Name = "System"
                        },
                        new
                        {
                            Id = 2L,
                            Deleted = false,
                            Guid = new Guid("90c48cf1-1a2b-4a76-b30b-260ecb149ccc"),
                            Name = "Domain"
                        },
                        new
                        {
                            Id = 3L,
                            Deleted = false,
                            Guid = new Guid("35eb8c23-4528-49a7-a798-b8bae3b06daf"),
                            Name = "Print Specifications",
                            ParentId = 1L
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomField", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<long>("GlossaryId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasAlternateKey("GlossaryId", "CustomFieldId");

                    b.HasIndex("CustomFieldId");

                    b.ToTable("GlossaryCustomFields", "Glossaries");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            CustomFieldId = 1L,
                            GlossaryId = 3L
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomFieldValue", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<long>("CustomFieldId")
                        .HasColumnType("bigint");

                    b.Property<string>("DisplayValue")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long>("GlossaryId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("Index")
                        .HasColumnType("bigint");

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasAlternateKey("GlossaryId", "CustomFieldId", "Index");

                    b.HasIndex("CustomFieldId");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("GlossaryId", "CustomFieldId", "Index")
                        .IsUnique();

                    b.ToTable("GlossaryCustomFieldValues", "Glossaries");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Mail.MailTemplate", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<long>("DomainId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<int>("MailType")
                        .HasColumnType("int");

                    b.Property<string>("Subject")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TemplateDefinition")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("DomainId", "MailType")
                        .IsUnique();

                    b.ToTable("MailTemplates", "Mail");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("32b657af-5e17-47f3-b8dc-59580516b141"),
                            MailType = 0,
                            Subject = "Confirmation e-mail",
                            TemplateDefinition = "<h1>Please confirm your e-mail</h1> Welcome to .  <a href=\"$url\">Please click on this link to confirm your e-mail address is correct.</a>"
                        },
                        new
                        {
                            Id = 2L,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("77fff2b0-dd8c-43e6-a9fd-304c79850f81"),
                            MailType = 2,
                            Subject = "Password reset",
                            TemplateDefinition = "<h1>Please follow the link to reset your password</h1><br><a href=\"$url\">Reset Password</a>"
                        },
                        new
                        {
                            Id = 3L,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("2e2d84a5-be1c-4e3b-a86a-bdafed42801b"),
                            MailType = 1,
                            Subject = "Disable two factor authentication",
                            TemplateDefinition = "<h1>Please follow the link to reset two factor authentication</h1><br><a href=\"$url\">Disable two factor authentication</a>"
                        },
                        new
                        {
                            Id = 4L,
                            Deleted = false,
                            DomainId = 1L,
                            Guid = new Guid("421b67c7-5f4b-4cad-adc5-528e2921790c"),
                            MailType = 3,
                            Subject = "Password successfully reset",
                            TemplateDefinition = "<h1>Your password has been reset. Please contact your admin if this wasn't you.</h1>"
                        });
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Organisation", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("Address")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Id")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("Organisations", "Printer");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.OrganisationContact", b =>
                {
                    b.Property<long>("OrganisationId")
                        .HasColumnType("bigint");

                    b.Property<long>("ContactId")
                        .HasColumnType("bigint");

                    b.Property<bool>("Primary")
                        .HasColumnType("bit");

                    b.HasKey("OrganisationId", "ContactId");

                    b.HasIndex("ContactId");

                    b.ToTable("OrganisationContacts", "Printer");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("Address")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<long>("OrganisationId")
                        .HasColumnType("bigint");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("OrganisationId", "Name")
                        .IsUnique();

                    b.ToTable("Sites", "Printer");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.SiteContact", b =>
                {
                    b.Property<long>("SiteId")
                        .HasColumnType("bigint");

                    b.Property<long>("ContactId")
                        .HasColumnType("bigint");

                    b.Property<bool>("Primary")
                        .HasColumnType("bit");

                    b.HasKey("SiteId", "ContactId");

                    b.HasIndex("ContactId");

                    b.ToTable("SiteContacts", "Printer");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Specification", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<long>("FormInstanceId")
                        .HasColumnType("bigint");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<long>("SiteId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("FormInstanceId");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Id")
                        .IsUnique();

                    b.HasIndex("SiteId", "Name")
                        .IsUnique();

                    b.ToTable("Specifications", "Printer");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Sentinel.FailedAccessAttempt", b =>
                {
                    b.Property<string>("IPAddress")
                        .HasMaxLength(50)
                        .HasColumnType("nvarchar(50)");

                    b.Property<DateTimeOffset>("AttemptedTime")
                        .HasColumnType("datetimeoffset");

                    b.HasKey("IPAddress", "AttemptedTime");

                    b.ToTable("FailedAccessAttempts", "Sentinel");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Sequences.Sequence", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("Increment")
                        .HasColumnType("bigint");

                    b.Property<DateTimeOffset?>("LastIssueDate")
                        .HasColumnType("datetimeoffset");

                    b.Property<long?>("LastIssueValue")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Pattern")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("nvarchar(255)");

                    b.Property<int>("Rollover")
                        .HasColumnType("int");

                    b.Property<long>("Seed")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("Sequences", "Sequences");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.EmailUserAction", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<DateTimeOffset>("Created")
                        .HasColumnType("datetimeoffset");

                    b.Property<int>("EmailActionType")
                        .HasColumnType("int");

                    b.Property<DateTimeOffset>("Expires")
                        .HasColumnType("datetimeoffset");

                    b.Property<Guid>("Token")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasAlternateKey("Token", "EmailActionType");

                    b.HasIndex("UserId");

                    b.ToTable("EmailUserActions", "UserManager");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SingleUseGuid", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<DateTimeOffset>("Expires")
                        .HasColumnType("datetimeoffset");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("UserId");

                    b.ToTable("SingleUseGuids", "UserManager");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SsoProvider", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<string>("AuthorizationEndpoint")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClientId")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ClientSecret")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Deleted")
                        .HasColumnType("bit");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<bool>("IsPublic")
                        .HasColumnType("bit");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("TokenEndpoint")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("ValidIssuer")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("SsoProviders", "UserManager");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.User", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));

                    b.Property<bool>("Active")
                        .HasColumnType("bit");

                    b.Property<DateTimeOffset>("Created")
                        .HasColumnType("datetimeoffset");

                    b.Property<long>("DomainId")
                        .HasColumnType("bigint");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(450)");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("bit");

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<Guid>("Guid")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<DateTimeOffset>("LastUpdated")
                        .HasColumnType("datetimeoffset");

                    b.Property<string>("MiddleNames")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<long?>("SsoProviderId")
                        .HasColumnType("bigint");

                    b.Property<string>("SsoSubject")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("TwoFactorAuthenticationKey")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("UsingTwoFactorAuthentication")
                        .HasColumnType("bit");

                    b.HasKey("Id");

                    b.HasIndex("DomainId");

                    b.HasIndex("Email")
                        .IsUnique();

                    b.HasIndex("Guid")
                        .IsUnique();

                    b.HasIndex("SsoProviderId");

                    b.ToTable("Users", "UserManager");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            Active = true,
                            Created = new DateTimeOffset(new DateTime(2022, 6, 9, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
                            DomainId = 1L,
                            Email = "testuser1@sun-strategy.com",
                            EmailConfirmed = true,
                            FirstName = "Test1",
                            Guid = new Guid("30cfcd5b-3385-43f1-b59a-fd35236f3d92"),
                            LastName = "User",
                            LastUpdated = new DateTimeOffset(new DateTime(2022, 6, 9, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
                            MiddleNames = "",
                            Password = "AgAAAAIAACcQAAAAAAAAABDGmF9Hre4l8k9lkZAxBRJk0zNHD2b6xfKz4C7h6UjuirkoyoP2fVR6d9b7riT03UnL5yAgFh2pSSVQDx+nQ5PBjZRB9UG4u5FrY8W7ouA/+w==",
                            SsoSubject = "",
                            TwoFactorAuthenticationKey = "4EHHG42OWCN3L72TSRYSHTV6MRJXVOY3",
                            UsingTwoFactorAuthentication = false
                        });
                });

            modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDrillHierarchy", b =>
                {
                    b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditEntry", "ChildAuditDrillDownEntity")
                        .WithMany()
                        .HasForeignKey("ChildAuditDrillDownEntityId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditEntry", "ParentAuditDrillDownEntity")
                        .WithMany()
                        .HasForeignKey("ParentAuditDrillDownEntityId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("ChildAuditDrillDownEntity");

                    b.Navigation("ParentAuditDrillDownEntity");
                });

            modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditEntry", b =>
                {
                    b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditDetail", "AuditLog")
                        .WithMany()
                        .HasForeignKey("AuditLogId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AuditLog");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldFormTemplate", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplate", "FormTemplate")
                        .WithMany()
                        .HasForeignKey("FormTemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("FormTemplate");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldGlossary", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary")
                        .WithMany()
                        .HasForeignKey("GlossaryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("Glossary");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldNumber", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldSequence", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Sequences.Sequence", "Sequence")
                        .WithMany()
                        .HasForeignKey("SequenceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("Sequence");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldText", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Domain", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.UserManager.SsoProvider", "SsoProvider")
                        .WithMany()
                        .HasForeignKey("SsoProviderId");

                    b.Navigation("SsoProvider");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Role", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain")
                        .WithMany()
                        .HasForeignKey("DomainId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Domain");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.RoleAccess", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Role", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Role");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserAccess", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain")
                        .WithMany()
                        .HasForeignKey("DomainId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Domain");

                    b.Navigation("User");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserRole", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Role", "Role")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Role");

                    b.Navigation("User");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormFieldInstance", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Forms.FormInstance", "FormInstance")
                        .WithMany("FormFields")
                        .HasForeignKey("FormInstanceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("FormInstance");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", "FormTemplateVersion")
                        .WithMany()
                        .HasForeignKey("FormTemplateVersionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("FormTemplateVersion");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplate", "Template")
                        .WithMany("Versions")
                        .HasForeignKey("TemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Template");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Parent")
                        .WithMany()
                        .HasForeignKey("ParentId");

                    b.Navigation("Parent");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomField", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary")
                        .WithMany("CustomFieldDefinitions")
                        .HasForeignKey("GlossaryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("Glossary");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomFieldValue", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField")
                        .WithMany()
                        .HasForeignKey("CustomFieldId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary")
                        .WithMany("CustomFieldValues")
                        .HasForeignKey("GlossaryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CustomField");

                    b.Navigation("Glossary");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Mail.MailTemplate", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain")
                        .WithMany()
                        .HasForeignKey("DomainId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Domain");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.OrganisationContact", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Contacts.Contact", "Contact")
                        .WithMany()
                        .HasForeignKey("ContactId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Printer.Organisation", "Organisation")
                        .WithMany()
                        .HasForeignKey("OrganisationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Contact");

                    b.Navigation("Organisation");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Printer.Organisation", "Organisation")
                        .WithMany("Sites")
                        .HasForeignKey("OrganisationId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Organisation");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.SiteContact", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Contacts.Contact", "Contact")
                        .WithMany()
                        .HasForeignKey("ContactId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Printer.Site", "Site")
                        .WithMany()
                        .HasForeignKey("SiteId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Contact");

                    b.Navigation("Site");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Specification", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Forms.FormInstance", "FormInstance")
                        .WithMany()
                        .HasForeignKey("FormInstanceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.Printer.Site", "Site")
                        .WithMany("Specifications")
                        .HasForeignKey("SiteId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("FormInstance");

                    b.Navigation("Site");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.EmailUserAction", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SingleUseGuid", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.User", b =>
                {
                    b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain")
                        .WithMany()
                        .HasForeignKey("DomainId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("e_suite.Database.Core.Tables.UserManager.SsoProvider", "SsoProvider")
                        .WithMany()
                        .HasForeignKey("SsoProviderId");

                    b.Navigation("Domain");

                    b.Navigation("SsoProvider");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b =>
                {
                    b.Navigation("FormFields");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplate", b =>
                {
                    b.Navigation("Versions");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b =>
                {
                    b.Navigation("CustomFieldDefinitions");

                    b.Navigation("CustomFieldValues");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Organisation", b =>
                {
                    b.Navigation("Sites");
                });

            modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b =>
                {
                    b.Navigation("Specifications");
                });
#pragma warning restore 612, 618
        }
    }
}
