//
using System;
using Data.SeaHavenIndustries;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260416212330_AddExternalSyncFields")]
partial class AddExternalSyncFields
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Data.SeaHavenIndustries.Accounts", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("About")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("CurrencyCode")
.HasColumnType("nvarchar(max)");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Email")
.HasColumnType("nvarchar(max)");
b.Property("FacebookUrl")
.HasColumnType("nvarchar(max)");
b.Property("Importance")
.HasColumnType("int");
b.Property("IndustryId")
.HasColumnType("int");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LinkedInUrl")
.HasColumnType("nvarchar(max)");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("OwnerEmployeeId")
.HasColumnType("int");
b.Property("Phone")
.HasColumnType("nvarchar(max)");
b.Property("PrivacySetting")
.HasColumnType("nvarchar(max)");
b.Property("ServiceInstructions")
.HasColumnType("nvarchar(max)");
b.Property("Tags")
.HasColumnType("nvarchar(max)");
b.Property("TerritoryId")
.HasColumnType("int");
b.Property("TimeZone")
.HasColumnType("nvarchar(max)");
b.Property("TwitterUrl")
.HasColumnType("nvarchar(max)");
b.Property("Type")
.HasColumnType("nvarchar(max)");
b.Property("Website")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Accounts");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Addresses", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("int");
b.Property("Address1")
.HasColumnType("nvarchar(max)");
b.Property("Address2")
.HasColumnType("nvarchar(max)");
b.Property("AddressType")
.HasColumnType("nvarchar(max)");
b.Property("City")
.HasColumnType("nvarchar(max)");
b.Property("ContactId")
.HasColumnType("int");
b.Property("Country")
.HasColumnType("nvarchar(max)");
b.Property("County")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("State")
.HasColumnType("nvarchar(max)");
b.Property("Zip")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("ContactId");
b.ToTable("Addresses");
});
modelBuilder.Entity("Data.SeaHavenIndustries.ApplicationUser", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("AccessFailedCount")
.HasColumnType("int");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Contact")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeletedDate")
.HasColumnType("datetime2");
b.Property("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("EmailConfirmed")
.HasColumnType("bit");
b.Property("FirstName")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastName")
.HasColumnType("nvarchar(max)");
b.Property("Locations")
.HasColumnType("nvarchar(max)");
b.Property("LockoutEnabled")
.HasColumnType("bit");
b.Property("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property("TwoFactorEnabled")
.HasColumnType("bit");
b.Property("Type")
.HasColumnType("int");
b.Property("UniqueName")
.HasColumnType("nvarchar(max)");
b.Property("UserImage")
.HasColumnType("nvarchar(max)");
b.Property("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Data.SeaHavenIndustries.Assets", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("int");
b.Property("AssetCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("IsActive")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LocationId")
.HasColumnType("int");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("LocationId");
b.ToTable("Assets");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Category", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Categories");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Comments", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Commenter")
.HasColumnType("nvarchar(max)");
b.Property("Commenttext")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Documents")
.HasColumnType("nvarchar(max)");
b.Property("ExternalCommentId")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("RecordType")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("WorkerOrderId")
.HasColumnType("int");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("WorkerOrderId");
b.ToTable("Comments");
});
modelBuilder.Entity("Data.SeaHavenIndustries.ContactDetails", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("About")
.HasColumnType("nvarchar(max)");
b.Property("ContactId")
.HasColumnType("int");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DateOfBirth")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("FacebookUrl")
.HasColumnType("nvarchar(max)");
b.Property("Gender")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LinkedInUrl")
.HasColumnType("nvarchar(max)");
b.Property("PrivacySetting")
.HasColumnType("nvarchar(max)");
b.Property("Tags")
.HasColumnType("nvarchar(max)");
b.Property("Territory")
.HasColumnType("nvarchar(max)");
b.Property("TwitterUrl")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("ContactDetails");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Contacts", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("int");
b.Property("Address1")
.HasColumnType("nvarchar(max)");
b.Property("Address2")
.HasColumnType("nvarchar(max)");
b.Property("City")
.HasColumnType("nvarchar(max)");
b.Property("ContactType")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Email")
.HasColumnType("nvarchar(max)");
b.Property("FacebookUrl")
.HasColumnType("nvarchar(max)");
b.Property("FirstName")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LastName")
.HasColumnType("nvarchar(max)");
b.Property("LinkedInUrl")
.HasColumnType("nvarchar(max)");
b.Property("LocationId")
.HasColumnType("int");
b.Property("MiddleName")
.HasColumnType("nvarchar(max)");
b.Property("Owner")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property("State")
.HasColumnType("nvarchar(max)");
b.Property("Title")
.HasColumnType("nvarchar(max)");
b.Property("TwitterUrl")
.HasColumnType("nvarchar(max)");
b.Property("Zip")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("LocationId");
b.ToTable("Contacts");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Department", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Departments");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Employee", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("About")
.HasColumnType("nvarchar(max)");
b.Property("CanChangeProviderNumber")
.HasColumnType("bit");
b.Property("ConfirmUserName")
.HasColumnType("nvarchar(max)");
b.Property("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DateOfBirth")
.HasColumnType("datetime2");
b.Property("DepartmentId")
.HasColumnType("int");
b.Property("EmployeeNumber")
.HasColumnType("nvarchar(max)");
b.Property("FacebookUrl")
.HasColumnType("nvarchar(max)");
b.Property("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Gender")
.HasColumnType("int");
b.Property("HireDate")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("JobTitleId")
.HasColumnType("int");
b.Property("LastLogin")
.HasColumnType("datetime2");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("LinkedInUrl")
.HasColumnType("nvarchar(max)");
b.Property("MiddleName")
.HasColumnType("nvarchar(max)");
b.Property("PermissionGroupId")
.HasColumnType("int");
b.Property("RegionId")
.HasColumnType("int");
b.Property("SMSAddress")
.HasColumnType("nvarchar(max)");
b.Property("Status")
.HasColumnType("nvarchar(max)");
b.Property("TimeZone")
.HasColumnType("nvarchar(max)");
b.Property("TwitterUrl")
.HasColumnType("nvarchar(max)");
b.Property("UserName")
.HasColumnType("nvarchar(max)");
b.Property("Website")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("DepartmentId");
b.HasIndex("JobTitleId");
b.HasIndex("RegionId");
b.ToTable("Employees");
});
modelBuilder.Entity("Data.SeaHavenIndustries.EmployeeAddress", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("City")
.HasColumnType("nvarchar(max)");
b.Property("CountryCode")
.HasColumnType("nvarchar(max)");
b.Property("CountyId")
.HasColumnType("int");
b.Property("EmployeeId")
.HasColumnType("int");
b.Property("StateCode")
.HasColumnType("nvarchar(max)");
b.Property("Street")
.HasColumnType("nvarchar(max)");
b.Property("StreetLineTwo")
.HasColumnType("nvarchar(max)");
b.Property("Zip")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("EmployeeId")
.IsUnique();
b.ToTable("EmployeeAddresses");
});
modelBuilder.Entity("Data.SeaHavenIndustries.EmployeeEmail", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Address")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("EmailTypeId")
.HasColumnType("int");
b.Property("EmployeeId")
.HasColumnType("int");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("IsPrimary")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("EmployeeId");
b.ToTable("EmployeeEmails");
});
modelBuilder.Entity("Data.SeaHavenIndustries.EmployeePhone", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("EmployeeId")
.HasColumnType("int");
b.Property("Extension")
.HasColumnType("nvarchar(max)");
b.Property("IsPrimary")
.HasColumnType("bit");
b.Property("Number")
.HasColumnType("nvarchar(max)");
b.Property("PhoneTypeId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("EmployeeId");
b.ToTable("EmployeePhones");
});
modelBuilder.Entity("Data.SeaHavenIndustries.FollowUps", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AccountId")
.HasColumnType("int");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("EmployeeId")
.HasColumnType("int");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LocationId")
.HasColumnType("int");
b.Property("Reason")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ScheduleDate")
.HasColumnType("datetime2");
b.Property("ScheduleStartTime")
.HasColumnType("time");
b.Property("Status")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("WorkOrderId")
.HasColumnType("int");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("EmployeeId");
b.HasIndex("LocationId");
b.HasIndex("WorkOrderId");
b.ToTable("FollowUps");
});
modelBuilder.Entity("Data.SeaHavenIndustries.ForgetPasswordCode", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("ForgetPasswordCodes");
});
modelBuilder.Entity("Data.SeaHavenIndustries.JobTitle", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property