377 lines
13 KiB
C#
377 lines
13 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using DatabaseCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
namespace DatabaseCore.Migrations
|
|
{
|
|
[DbContext(typeof(DatabaseContext))]
|
|
partial class DatabaseContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
|
.HasAnnotation("ProductVersion", "5.0.4")
|
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Address")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("DateBirth")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("GroupElectricalSafety")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("HomeNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("MobileNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Patronymic")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<byte[]>("Photo")
|
|
.HasColumnType("varbinary(max)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("FirstName", "LastName", "Patronymic")
|
|
.IsUnique()
|
|
.HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL");
|
|
|
|
b.ToTable("Employees");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<Guid>("EmployeeId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("EmployeePostId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsExternalCombination")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsInternalCombination")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<decimal>("Rate")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
b.HasIndex("EmployeePostId");
|
|
|
|
b.ToTable("EmployeeEmployeePosts");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("EmployeePostName")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("Order")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EmployeePostName")
|
|
.IsUnique()
|
|
.HasFilter("[EmployeePostName] IS NOT NULL");
|
|
|
|
b.ToTable("EmployeePosts");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.Access", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<int>("AccessOperation")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AccessType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("Accesses");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("EnviromentSettings");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.Role", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("RoleName")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<int>("RolePriority")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleName")
|
|
.IsUnique()
|
|
.HasFilter("[RoleName] IS NOT NULL");
|
|
|
|
b.ToTable("Roles");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("Avatar")
|
|
.HasColumnType("varbinary(max)");
|
|
|
|
b.Property<int>("CountAttempt")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime?>("DateBanned")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateLastVisit")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsBanned")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserName")
|
|
.HasFilter("[UserName] IS NOT NULL");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime?>("DateDelete")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b =>
|
|
{
|
|
b.HasOne("DatabaseCore.Models.Department.Employee", "Employee")
|
|
.WithMany("EmployeeEmployeePosts")
|
|
.HasForeignKey("EmployeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost")
|
|
.WithMany("EmployeeEmployeePosts")
|
|
.HasForeignKey("EmployeePostId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Employee");
|
|
|
|
b.Navigation("EmployeePost");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.Access", b =>
|
|
{
|
|
b.HasOne("DatabaseCore.Models.Security.Role", "Role")
|
|
.WithMany("Access")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b =>
|
|
{
|
|
b.HasOne("DatabaseCore.Models.Security.Role", "Role")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DatabaseCore.Models.Security.User", "User")
|
|
.WithMany("UserRoles")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Role");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b =>
|
|
{
|
|
b.Navigation("EmployeeEmployeePosts");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b =>
|
|
{
|
|
b.Navigation("EmployeeEmployeePosts");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.Role", b =>
|
|
{
|
|
b.Navigation("Access");
|
|
|
|
b.Navigation("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("DatabaseCore.Models.Security.User", b =>
|
|
{
|
|
b.Navigation("UserRoles");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|