// <auto-generated />
using System;
using Gremlin.GremlinData.DBClasses;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

namespace Gremlin.Migrations
{
    [DbContext(typeof(GremlinContext))]
    [Migration("20210611102249_InitialCreate")]
    partial class InitialCreate
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Relational:MaxIdentifierLength", 64)
                .HasAnnotation("ProductVersion", "5.0.7");

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Account", b =>
                {
                    b.Property<uint>("AccountId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("AccountCreatedinSAPOn")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("AccountName")
                        .IsRequired()
                        .HasMaxLength(250)
                        .HasColumnType("varchar(250)");

                    b.Property<string>("AccountTypeCode")
                        .IsRequired()
                        .HasColumnType("Char(3)");

                    b.Property<string>("City")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<string>("EMail")
                        .HasMaxLength(150)
                        .HasColumnType("varchar(150)");

                    b.Property<string>("FaxNumber")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("FloorOrBuilding")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<float>("Latitude")
                        .HasColumnType("float");

                    b.Property<float>("Longitude")
                        .HasColumnType("float");

                    b.Property<string>("Notes")
                        .HasColumnType("longtext");

                    b.Property<int?>("ParentAccountId")
                        .HasColumnType("int");

                    b.Property<string>("PhoneNumber")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<uint>("SAPAccountNumber")
                        .HasColumnType("int unsigned");

                    b.Property<string>("Street")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("SubMarketCode")
                        .IsRequired()
                        .HasColumnType("Char(3)");

                    b.Property<string>("Webpage")
                        .HasMaxLength(250)
                        .HasColumnType("varchar(250)");

                    b.Property<string>("ZIP")
                        .IsRequired()
                        .HasColumnType("Char(5)");

                    b.HasKey("AccountId");

                    b.HasAlternateKey("SAPAccountNumber");

                    b.HasIndex("AccountTypeCode");

                    b.HasIndex("SubMarketCode");

                    b.ToTable("Accounts");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.AccountType", b =>
                {
                    b.Property<string>("AccountTypeCode")
                        .HasColumnType("Char(3)");

                    b.Property<string>("AccountTypeDescription")
                        .HasColumnType("Varchar(1000)");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.HasKey("AccountTypeCode");

                    b.ToTable("AccountTypes");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Contact", b =>
                {
                    b.Property<uint>("ContactId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<string>("AcademicTitle")
                        .HasColumnType("longtext");

                    b.Property<uint>("AccountId")
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<string>("Department")
                        .HasColumnType("longtext");

                    b.Property<string>("EMail")
                        .HasColumnType("longtext");

                    b.Property<bool>("EmailBounced")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("FirstName")
                        .HasColumnType("longtext");

                    b.Property<string>("Function")
                        .HasColumnType("longtext");

                    b.Property<byte>("Gender")
                        .HasColumnType("tinyint unsigned");

                    b.Property<bool?>("IsReference")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

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

                    b.Property<string>("LinkToSAP")
                        .HasColumnType("longtext");

                    b.Property<string>("MobileNumber")
                        .HasColumnType("longtext");

                    b.Property<bool>("NoHardcopyMailing")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("NoPhoneCalls")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Notes")
                        .HasColumnType("longtext");

                    b.Property<bool?>("OptInStatus")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredContactMethod")
                        .HasColumnType("longtext");

                    b.Property<string>("Room")
                        .HasColumnType("longtext");

                    b.Property<string>("SAPApplicationInterest")
                        .HasColumnType("longtext");

                    b.Property<string>("SAPCompetitiveIBase")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("SAPContactCreationDate")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("SAPContactModifiedDate")
                        .HasColumnType("datetime(6)");

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

                    b.Property<string>("SAPJobFunction")
                        .HasColumnType("longtext");

                    b.Property<string>("SAPJobLevel")
                        .HasColumnType("longtext");

                    b.Property<string>("SAPProductInterest")
                        .HasColumnType("longtext");

                    b.Property<bool>("ValidatedContact")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.HasKey("ContactId");

                    b.HasIndex("AccountId");

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.CustomDescription", b =>
                {
                    b.Property<uint>("CustomDescriptionId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<uint>("AccountId")
                        .HasColumnType("int unsigned");

                    b.Property<string>("CoverletterText")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<string>("DescriptionText")
                        .HasColumnType("longtext");

                    b.Property<string>("Heading")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("Note")
                        .HasColumnType("longtext");

                    b.Property<string>("OptionNumber")
                        .HasColumnType("longtext");

                    b.Property<uint>("ProductId")
                        .HasColumnType("int unsigned");

                    b.Property<string>("ProductNumber")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("CustomDescriptionId");

                    b.HasIndex("AccountId");

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

                    b.ToTable("CustomDescriptions");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.LineItem", b =>
                {
                    b.Property<uint>("QuoteId")
                        .HasColumnType("int unsigned");

                    b.Property<ushort>("Amount")
                        .HasColumnType("smallint unsigned");

                    b.Property<decimal>("ContractualDiscount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("decimal(65,30)")
                        .HasDefaultValue(0m);

                    b.Property<DateTime>("DataCreated")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataModified")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<decimal>("DemoDiscount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("decimal(65,30)")
                        .HasDefaultValue(0m);

                    b.Property<decimal>("ExtendedListPrice")
                        .HasColumnType("decimal(65,30)");

                    b.Property<uint>("LineItemId")
                        .HasColumnType("int unsigned");

                    b.Property<decimal>("ListPrice")
                        .HasColumnType("decimal(65,30)");

                    b.Property<decimal>("NetPrice")
                        .HasColumnType("decimal(65,30)");

                    b.Property<string>("OptionNumber")
                        .HasColumnType("longtext");

                    b.Property<ushort>("Position")
                        .HasColumnType("smallint unsigned");

                    b.Property<string>("ProductLine")
                        .HasColumnType("longtext");

                    b.Property<string>("ProductNumber")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<decimal>("PromotionalDiscount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("decimal(65,30)")
                        .HasDefaultValue(0m);

                    b.Property<decimal>("SalesDiscount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("decimal(65,30)")
                        .HasDefaultValue(0m);

                    b.Property<string>("SapLongDescription")
                        .HasColumnType("longtext");

                    b.Property<string>("SapShortDescription")
                        .HasColumnType("longtext");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(65,30)");

                    b.Property<decimal>("TotalDiscount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("decimal(65,30)")
                        .HasDefaultValue(0m);

                    b.HasKey("QuoteId");

                    b.ToTable("LineItems");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Product", b =>
                {
                    b.Property<uint>("ProductId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

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

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

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<bool>("HasBreakPrices")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime>("IntroductionDate")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("ListPrice")
                        .HasColumnType("decimal(65,30)");

                    b.Property<string>("OptionNumber")
                        .HasColumnType("longtext");

                    b.Property<uint?>("ProductLineId")
                        .HasColumnType("int unsigned");

                    b.Property<string>("ProductNumber")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("ProductStatus")
                        .HasColumnType("longtext");

                    b.Property<string>("SapLongDescription")
                        .HasColumnType("longtext");

                    b.Property<string>("SapShortDescription")
                        .HasColumnType("longtext");

                    b.Property<float>("Weight")
                        .HasColumnType("float");

                    b.HasKey("ProductId");

                    b.HasIndex("ProductLineId");

                    b.ToTable("Products");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.ProductLine", b =>
                {
                    b.Property<uint>("ProductLineId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<string>("ProductLineAbbreviation")
                        .HasColumnType("longtext");

                    b.Property<string>("ProductLineDescription")
                        .HasColumnType("longtext");

                    b.HasKey("ProductLineId");

                    b.ToTable("ProductLines");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Quote", b =>
                {
                    b.Property<uint>("QuoteId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("DataCreated")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataModified")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<DateTime>("QuotationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("datetime(6)");

                    b.Property<string>("QuotationNumber")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnType("VARCHAR(255)");

                    b.Property<bool>("QuoteContains3PP")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<bool>("QuoteContainsRB")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<string>("QuoteTemplate")
                        .HasColumnType("longtext");

                    b.Property<uint?>("RecipientContactId")
                        .HasColumnType("int unsigned");

                    b.Property<decimal>("TotalDiscount")
                        .HasColumnType("decimal(65,30)");

                    b.Property<decimal>("TotalGross")
                        .HasColumnType("decimal(65,30)");

                    b.Property<decimal>("TotalListprice")
                        .HasColumnType("decimal(65,30)");

                    b.Property<decimal>("TotalNet")
                        .HasColumnType("decimal(65,30)");

                    b.Property<float>("VAT")
                        .HasColumnType("float");

                    b.Property<byte>("ValidFor")
                        .HasColumnType("tinyint unsigned");

                    b.Property<DateTime>("ValidUntil")
                        .HasColumnType("datetime(6)");

                    b.HasKey("QuoteId");

                    b.HasIndex("RecipientContactId");

                    b.ToTable("Quotes");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.RUSetting", b =>
                {
                    b.Property<uint>("RUSettingsID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<uint>("RegisteredUserID")
                        .HasColumnType("int unsigned");

                    b.Property<string>("SettingKey")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("SettingValue")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("RUSettingsID");

                    b.HasIndex("RegisteredUserID");

                    b.ToTable("RUSettings");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.RegisteredUser", b =>
                {
                    b.Property<uint>("RegisteredUserID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("PasswordHash")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("UserName")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("RegisteredUserID");

                    b.ToTable("RegisteredUser");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.SubMarket", b =>
                {
                    b.Property<string>("SubMarketCode")
                        .HasColumnType("Char(3)");

                    b.Property<DateTime>("DataCreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<string>("DataModificationByUser")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TINYTEXT")
                        .HasDefaultValueSql("ON INSERT CURRENT_USER() ON UPDATE CURRENT_USER()");

                    b.Property<DateTime>("DataModificationDate")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("TIMESTAMP")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP");

                    b.Property<string>("DataStatus")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DataValidFrom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("CURRENT_TIMESTAMP");

                    b.Property<DateTime>("DataValidUntil")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("DATETIME")
                        .HasDefaultValueSql("'9999-12-31 23:59:59.000000'");

                    b.Property<string>("DataVersionComment")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("");

                    b.Property<uint>("DataVersionNumber")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int unsigned")
                        .HasDefaultValue(1u);

                    b.Property<string>("SubMarketDescription")
                        .HasColumnType("Varchar(1000)");

                    b.HasKey("SubMarketCode");

                    b.ToTable("SubMarkets");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Account", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.AccountType", "AccountType")
                        .WithMany("Accounts")
                        .HasForeignKey("AccountTypeCode")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Gremlin.GremlinData.EntityClasses.SubMarket", "SubMarket")
                        .WithMany("Accounts")
                        .HasForeignKey("SubMarketCode")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AccountType");

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Contact", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.Account", "Account")
                        .WithMany("Contacts")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.CustomDescription", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.Account", "Supplier")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Gremlin.GremlinData.EntityClasses.Product", "Product")
                        .WithOne("CustomDescription")
                        .HasForeignKey("Gremlin.GremlinData.EntityClasses.CustomDescription", "ProductId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Product");

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.LineItem", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.Quote", "Quote")
                        .WithMany("LineItems")
                        .HasForeignKey("QuoteId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Product", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.ProductLine", "ProductLine")
                        .WithMany("Products")
                        .HasForeignKey("ProductLineId");

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Quote", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.Contact", "Recipient")
                        .WithMany()
                        .HasForeignKey("RecipientContactId");

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.RUSetting", b =>
                {
                    b.HasOne("Gremlin.GremlinData.EntityClasses.RegisteredUser", "RegisteredUser")
                        .WithMany("RUSettings")
                        .HasForeignKey("RegisteredUserID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Account", b =>
                {
                    b.Navigation("Contacts");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.AccountType", b =>
                {
                    b.Navigation("Accounts");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Product", b =>
                {
                    b.Navigation("CustomDescription");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.ProductLine", b =>
                {
                    b.Navigation("Products");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.Quote", b =>
                {
                    b.Navigation("LineItems");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.RegisteredUser", b =>
                {
                    b.Navigation("RUSettings");
                });

            modelBuilder.Entity("Gremlin.GremlinData.EntityClasses.SubMarket", b =>
                {
                    b.Navigation("Accounts");
                });
#pragma warning restore 612, 618
        }
    }
}
