// 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("Id") .HasColumnType("uniqueidentifier"); b.Property("Address") .HasColumnType("nvarchar(max)"); b.Property("DateBirth") .HasColumnType("datetime2"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("Email") .HasColumnType("nvarchar(max)"); b.Property("FirstName") .HasColumnType("nvarchar(450)"); b.Property("GroupElectricalSafety") .HasColumnType("nvarchar(max)"); b.Property("HomeNumber") .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("LastName") .HasColumnType("nvarchar(450)"); b.Property("MobileNumber") .HasColumnType("nvarchar(max)"); b.Property("Patronymic") .HasColumnType("nvarchar(450)"); b.Property("Photo") .HasColumnType("varbinary(max)"); b.Property("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("Id") .HasColumnType("uniqueidentifier"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("EmployeeId") .HasColumnType("uniqueidentifier"); b.Property("EmployeePostId") .HasColumnType("uniqueidentifier"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("IsExternalCombination") .HasColumnType("bit"); b.Property("IsInternalCombination") .HasColumnType("bit"); b.Property("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("Id") .HasColumnType("uniqueidentifier"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("EmployeePostName") .HasColumnType("nvarchar(450)"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("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("Id") .HasColumnType("uniqueidentifier"); b.Property("AccessOperation") .HasColumnType("int"); b.Property("AccessType") .HasColumnType("int"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("RoleId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("Accesses"); }); modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); b.Property("Description") .HasColumnType("nvarchar(max)"); b.Property("Key") .IsRequired() .HasColumnType("nvarchar(450)"); b.Property("Value") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("Key") .IsUnique(); b.ToTable("EnviromentSettings"); }); modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("RoleName") .HasColumnType("nvarchar(450)"); b.Property("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("Id") .HasColumnType("uniqueidentifier"); b.Property("Avatar") .HasColumnType("varbinary(max)"); b.Property("CountAttempt") .HasColumnType("int"); b.Property("DateBanned") .HasColumnType("datetime2"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("DateLastVisit") .HasColumnType("datetime2"); b.Property("IsBanned") .HasColumnType("bit"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("PasswordHash") .HasColumnType("nvarchar(max)"); b.Property("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("Id") .HasColumnType("uniqueidentifier"); b.Property("DateCreate") .HasColumnType("datetime2"); b.Property("DateDelete") .HasColumnType("datetime2"); b.Property("IsDeleted") .HasColumnType("bit"); b.Property("RoleId") .HasColumnType("uniqueidentifier"); b.Property("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 } } }