//
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("20231222052903_templateupdated")]
partial class templateupdated
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
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.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("Commenttext")
.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("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.Contacts", 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("Email")
.HasColumnType("nvarchar(max)");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Contacts");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Locations", 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("Latitude")
.HasColumnType("nvarchar(max)");
b.Property("Longitude")
.HasColumnType("nvarchar(max)");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("Title")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Locations");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Quotes", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("BillingAddress")
.HasColumnType("nvarchar(max)");
b.Property("ContactId")
.HasColumnType("int");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("Date")
.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("PO")
.HasColumnType("nvarchar(max)");
b.Property("ProjectName")
.HasColumnType("nvarchar(max)");
b.Property("QuotId")
.HasColumnType("nvarchar(max)");
b.Property("ShippingAddress")
.HasColumnType("nvarchar(max)");
b.Property("SiteId")
.HasColumnType("nvarchar(max)");
b.Property("SiteName")
.HasColumnType("nvarchar(max)");
b.Property("TT")
.HasColumnType("nvarchar(max)");
b.Property("WorkorderId")
.HasColumnType("int");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ContactId");
b.HasIndex("WorkorderId");
b.ToTable("Quotes");
});
modelBuilder.Entity("Data.SeaHavenIndustries.QuotesLineItems", 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("Lineitem")
.HasColumnType("decimal(18,2)");
b.Property("LineitemNumber")
.HasColumnType("int");
b.Property("QuoteId")
.HasColumnType("int");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("QuoteId");
b.ToTable("QuotesLineItems");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Template", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AfterPhotoAttachment")
.HasColumnType("nvarchar(max)");
b.Property("AfterPhotoIssue")
.HasColumnType("nvarchar(max)");
b.Property("AssignTo")
.HasColumnType("nvarchar(450)");
b.Property("Attachments")
.HasColumnType("nvarchar(max)");
b.Property("BeforPhotoAttachment")
.HasColumnType("nvarchar(max)");
b.Property("BeforPhotoIssue")
.HasColumnType("nvarchar(max)");
b.Property("CategoryId")
.HasColumnType("int");
b.Property("ContactId")
.HasColumnType("int");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("DueDate")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LocationId")
.HasColumnType("int");
b.Property("PO")
.HasColumnType("nvarchar(max)");
b.Property("Priority")
.HasColumnType("nvarchar(max)");
b.Property("SignOffAttachment")
.HasColumnType("nvarchar(max)");
b.Property("SignOffName")
.HasColumnType("nvarchar(max)");
b.Property("SignOffSignature")
.HasColumnType("nvarchar(max)");
b.Property("Status")
.HasColumnType("nvarchar(max)");
b.Property("TT")
.HasColumnType("nvarchar(max)");
b.Property("WorkerOrderNumber")
.HasColumnType("nvarchar(max)");
b.Property("WorkerOrderTitle")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AssignTo");
b.HasIndex("CategoryId");
b.HasIndex("ContactId");
b.HasIndex("LocationId");
b.ToTable("Templates");
});
modelBuilder.Entity("Data.SeaHavenIndustries.WorkOrder", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("AfterPhotoAttachment")
.HasColumnType("nvarchar(max)");
b.Property("AfterPhotoIssue")
.HasColumnType("nvarchar(max)");
b.Property("AssignTo")
.HasColumnType("nvarchar(450)");
b.Property("Attachments")
.HasColumnType("nvarchar(max)");
b.Property("BeforPhotoAttachment")
.HasColumnType("nvarchar(max)");
b.Property("BeforPhotoIssue")
.HasColumnType("nvarchar(max)");
b.Property("CategoryId")
.HasColumnType("int");
b.Property("ContactId")
.HasColumnType("int");
b.Property("CreatedDate")
.HasColumnType("datetime2");
b.Property("DeleterUserId")
.HasColumnType("nvarchar(max)");
b.Property("DeletionTime")
.HasColumnType("datetime2");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("DueDate")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LastModificationTime")
.HasColumnType("datetime2");
b.Property("LastModifierUserId")
.HasColumnType("int");
b.Property("LocationId")
.HasColumnType("int");
b.Property("PO")
.HasColumnType("nvarchar(max)");
b.Property("Priority")
.HasColumnType("nvarchar(max)");
b.Property("SignOffAttachment")
.HasColumnType("nvarchar(max)");
b.Property("SignOffName")
.HasColumnType("nvarchar(max)");
b.Property("SignOffSignature")
.HasColumnType("nvarchar(max)");
b.Property("Status")
.HasColumnType("nvarchar(max)");
b.Property("TT")
.HasColumnType("nvarchar(max)");
b.Property("WorkerOrderNumber")
.HasColumnType("nvarchar(max)");
b.Property("WorkerOrderTitle")
.HasColumnType("nvarchar(max)");
b.Property("createdby")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AssignTo");
b.HasIndex("CategoryId");
b.HasIndex("ContactId");
b.HasIndex("LocationId");
b.ToTable("workOrders");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
.HasColumnType("nvarchar(450)");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderKey")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.Property("UserId")
.HasColumnType("nvarchar(450)");
b.Property("LoginProvider")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Name")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Data.SeaHavenIndustries.Comments", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", "ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.WorkOrder", "WorkOrder")
.WithMany("Comments")
.HasForeignKey("WorkerOrderId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("ApplicationUser");
b.Navigation("WorkOrder");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Quotes", b =>
{
b.HasOne("Data.SeaHavenIndustries.Contacts", "Contacts")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.WorkOrder", "WorkOrder")
.WithMany("Quotes")
.HasForeignKey("WorkorderId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Contacts");
b.Navigation("WorkOrder");
});
modelBuilder.Entity("Data.SeaHavenIndustries.QuotesLineItems", b =>
{
b.HasOne("Data.SeaHavenIndustries.Quotes", "Quotes")
.WithMany("LineItems")
.HasForeignKey("QuoteId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Quotes");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Template", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", "AssignToUser")
.WithMany("Templates")
.HasForeignKey("AssignTo")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Category", "Category")
.WithMany("Templates")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Contacts", "POC")
.WithMany()
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Locations", "Locations")
.WithMany("Templates")
.HasForeignKey("LocationId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("AssignToUser");
b.Navigation("Category");
b.Navigation("Locations");
b.Navigation("POC");
});
modelBuilder.Entity("Data.SeaHavenIndustries.WorkOrder", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", "AssignToUser")
.WithMany("WorkOrders")
.HasForeignKey("AssignTo")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Category", "Category")
.WithMany("WorkOrders")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Contacts", "POC")
.WithMany("workOrders")
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("Data.SeaHavenIndustries.Locations", "Locations")
.WithMany("workOrders")
.HasForeignKey("LocationId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("AssignToUser");
b.Navigation("Category");
b.Navigation("Locations");
b.Navigation("POC");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
{
b.HasOne("Data.SeaHavenIndustries.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Data.SeaHavenIndustries.ApplicationUser", b =>
{
b.Navigation("Templates");
b.Navigation("WorkOrders");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Category", b =>
{
b.Navigation("Templates");
b.Navigation("WorkOrders");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Contacts", b =>
{
b.Navigation("workOrders");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Locations", b =>
{
b.Navigation("Templates");
b.Navigation("workOrders");
});
modelBuilder.Entity("Data.SeaHavenIndustries.Quotes", b =>
{
b.Navigation("LineItems");
});
modelBuilder.Entity("Data.SeaHavenIndustries.WorkOrder", b =>
{
b.Navigation("Comments");
b.Navigation("Quotes");
});
#pragma warning restore 612, 618
}
}
}