Compare commits
150 Commits
Author | SHA1 | Date | |
---|---|---|---|
1f864dda44 | |||
97ae32a479 | |||
42dad18c0f | |||
5fa8270cc4 | |||
7a94448f94 | |||
11db061b1a | |||
be261d84d4 | |||
92f9e9f8e9 | |||
b59e0e09c2 | |||
6840a8966f | |||
72cb1f1e63 | |||
faa59fbd6e | |||
a17e888901 | |||
6c2bb49d4d | |||
0afe8a7682 | |||
070f2129e4 | |||
7f91c8086f | |||
074fc405ed | |||
df73a0d314 | |||
d1fcf069b3 | |||
195e81bbb0 | |||
58cdb371c5 | |||
9df61f850d | |||
34fe571fdc | |||
9c76b680b7 | |||
4fa2dc1779 | |||
05d88ca8f1 | |||
cce896bf2b | |||
07060426c4 | |||
513c14b73d | |||
2ccbccd6d4 | |||
d6c066ec0f | |||
04e6e6766b | |||
ed95a8eee3 | |||
e4377b8801 | |||
952d283aac | |||
c7a24dcaad | |||
9f6450142a | |||
941794b273 | |||
7b682e50d7 | |||
1d3d35d106 | |||
6e2e10aa14 | |||
9b066d5c25 | |||
c4402d976d | |||
48ad010501 | |||
d79be9a8dc | |||
2acaecbf8d | |||
61a84b6b68 | |||
5694e531b6 | |||
ba184943c4 | |||
68c01f1801 | |||
8169b49a94 | |||
c52d235a6c | |||
b8ba47f2b9 | |||
fcad2e9815 | |||
d93117f01a | |||
301854f284 | |||
11cb574c3a | |||
4fc7c24c81 | |||
d5319759e2 | |||
4008a5e2a5 | |||
754edb3e2a | |||
23a136e0b4 | |||
c5d3000878 | |||
1f4ee6b285 | |||
a5ac4947d0 | |||
b86492fa1c | |||
3a80f07f55 | |||
de06462404 | |||
b0675d3e19 | |||
3d17927bce | |||
dc0f0e376e | |||
464d26359a | |||
cf3c1f8379 | |||
d9321668a2 | |||
054ad31744 | |||
985c119bb9 | |||
ecee1a9eeb | |||
9d68f31846 | |||
34ff70b8ca | |||
6368698bff | |||
f9f88d7098 | |||
cf1aa5f50c | |||
5e379c7e2e | |||
574b308949 | |||
1b3e7201a7 | |||
908c920d26 | |||
0012615e11 | |||
e884d5e332 | |||
787ca778fe | |||
d9126dde2b | |||
cc4d0ddb70 | |||
e990f0ba5f | |||
6992a7df68 | |||
4bb7f3c12c | |||
3aaa8edb09 | |||
89affe64e3 | |||
6c835fd8e5 | |||
b30c8bdf5b | |||
5821eb5c06 | |||
999fb75c98 | |||
94b54e712e | |||
f2921ecc7a | |||
4230c26a1a | |||
99bcbb6945 | |||
edd0dc9fdb | |||
f8bbebe473 | |||
ed1f4cf07e | |||
ba47e48eeb | |||
356c8a6d02 | |||
1a027e7583 | |||
11c8de59e8 | |||
680823a981 | |||
e17b723899 | |||
2ce5f9b653 | |||
ed483159e8 | |||
2c64975fb1 | |||
e8836c8806 | |||
1df43b5105 | |||
da3e126579 | |||
9325f592e1 | |||
fa5b3abe82 | |||
c5001cbd7a | |||
3a29225011 | |||
8578045f56 | |||
23a08e13b6 | |||
c749987c08 | |||
349ba066fd | |||
65b2c39f0b | |||
f63cbb816d | |||
e7a6a41eed | |||
e8f9434a92 | |||
9c5dffefbb | |||
3609c0edc6 | |||
b27ff70c49 | |||
c2e16bf3f9 | |||
5bf1f6b754 | |||
269be03ec2 | |||
d7691141c9 | |||
626759b0c5 | |||
ddcdef0aed | |||
f57191019d | |||
f92ed77c59 | |||
8ad72cd50d | |||
525add0260 | |||
74549aa18d | |||
1e1896c68d | |||
3893ebdb19 | |||
08f50f6e11 | |||
4acf81d087 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,6 +12,8 @@
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
WindowDestopExtensions/
|
||||
ImplementationExtensions/
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
@ -0,0 +1,272 @@
|
||||
using CoreDatabase.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ToolsModule.ManagmentEntity;
|
||||
using ToolsModule.ManagmentMapping;
|
||||
|
||||
namespace CoreDatabase
|
||||
{
|
||||
public abstract class AbstractGenerticEntityService<G, S, T, L, E> : IGenericEntityService<G, S>
|
||||
where G : GetBindingModel
|
||||
where S : SetBindingModel
|
||||
where T : BaseEntity
|
||||
where L : ListViewModel<E>, new()
|
||||
where E : ElementViewModel
|
||||
{
|
||||
public OperationResultModel Create(S model)
|
||||
{
|
||||
using var context = DatabaseManager.GetContext;
|
||||
|
||||
var result = AdditionalCheckingWhenAdding(context, model);
|
||||
if (!result.IsSucceeded)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var exsistEntity = GetUniqueEntity(model, IncludingWhenReading(context.Set<T>().AsQueryable()));
|
||||
if (exsistEntity == null)
|
||||
{
|
||||
var entity = Mapper.MapToClass<S, T>(model, true);
|
||||
context.Set<T>().Add(entity);
|
||||
context.SaveChanges();
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(entity, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (exsistEntity.IsDeleted)
|
||||
{
|
||||
exsistEntity = Mapper.MapToClass(model, exsistEntity, true);
|
||||
exsistEntity.IsDeleted = false;
|
||||
context.SaveChanges();
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(exsistEntity, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент уже существует", ResultServiceStatusCode.ExsistItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResultModel Delete(G model)
|
||||
{
|
||||
using var context = DatabaseManager.GetContext;
|
||||
using var transaction = context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
var entity = context.Set<T>().FirstOrDefault(x => x.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound);
|
||||
}
|
||||
else if (entity.IsDeleted)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент был удален", ResultServiceStatusCode.WasDelete);
|
||||
}
|
||||
|
||||
var result = AdditionalCheckingWhenDeleting(context, entity, model);
|
||||
if (!result.IsSucceeded)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
entity.IsDeleted = true;
|
||||
entity.DateDelete = DateTime.Now;
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
AdditionalDeleting(context, entity, model);
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
transaction.Rollback();
|
||||
throw;
|
||||
}
|
||||
|
||||
return OperationResultModel.Success(true);
|
||||
}
|
||||
|
||||
public OperationResultModel Restore(G model)
|
||||
{
|
||||
if (model.Id.HasValue || AdditionalCheckForSingleGet(model))
|
||||
{
|
||||
using var context = DatabaseManager.GetContext;
|
||||
var entity = model.Id.HasValue ? IncludingWhenReading(context.Set<T>().AsQueryable()).FirstOrDefault(x => x.Id == model.Id.Value)
|
||||
: GetSingleRecord(IncludingWhenReading(context.Set<T>().AsQueryable()), model);
|
||||
if (entity == null)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound);
|
||||
}
|
||||
else if (!entity.IsDeleted)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент не был удален", ResultServiceStatusCode.ExsistItem);
|
||||
}
|
||||
entity.IsDeleted = false;
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(entity, true));
|
||||
}
|
||||
return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound);
|
||||
}
|
||||
|
||||
public OperationResultModel Read(G model)
|
||||
{
|
||||
int countPages = 0;
|
||||
using var context = DatabaseManager.GetContext;
|
||||
|
||||
// для одной записи
|
||||
if (model.Id.HasValue || AdditionalCheckForSingleGet(model))
|
||||
{
|
||||
var entity = model.Id.HasValue ? IncludingWhenReading(context.Set<T>().AsQueryable()).FirstOrDefault(x => x.Id == model.Id.Value)
|
||||
: GetSingleRecord(IncludingWhenReading(context.Set<T>().AsQueryable()), model);
|
||||
if (entity == null)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound);
|
||||
}
|
||||
if (entity.IsDeleted)
|
||||
{
|
||||
if (model.IgnoreDeleted)
|
||||
{
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(entity, model.HaveRight));
|
||||
}
|
||||
return OperationResultModel.Error("Error:", "Элемент удален", ResultServiceStatusCode.WasDelete);
|
||||
}
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(entity, model.HaveRight));
|
||||
}
|
||||
|
||||
var query = context.Set<T>().Where(x => !x.IsDeleted).AsQueryable();
|
||||
|
||||
query = AdditionalCheckingWhenReadingList(query, model);
|
||||
|
||||
query = OrderingWhenReading(query);
|
||||
|
||||
query = IncludingWhenReading(query);
|
||||
|
||||
if (model.PageNumber.HasValue && model.PageSize.HasValue)
|
||||
{
|
||||
countPages = (int)Math.Ceiling((double)query.Count() / model.PageSize.Value);
|
||||
query = query
|
||||
.Skip(model.PageSize.Value * model.PageNumber.Value)
|
||||
.Take(model.PageSize.Value);
|
||||
}
|
||||
var result = new L
|
||||
{
|
||||
MaxCount = countPages,
|
||||
List = query.Select(x => Mapper.MapToClass<T, E>(x, model.HaveRight)).ToList()
|
||||
};
|
||||
|
||||
return OperationResultModel.Success(result);
|
||||
}
|
||||
|
||||
public OperationResultModel Update(S model)
|
||||
{
|
||||
using var context = DatabaseManager.GetContext;
|
||||
|
||||
var result = AdditionalCheckingWhenUpdateing(context, model);
|
||||
if (!result.IsSucceeded)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var exsistEntity = GetUniqueEntity(model, IncludingWhenReading(context.Set<T>().AsQueryable()));
|
||||
if (exsistEntity != null)
|
||||
{
|
||||
if (exsistEntity.IsDeleted)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Существует удаленная запись с такими значениями", ResultServiceStatusCode.ExsistItem);
|
||||
}
|
||||
return OperationResultModel.Error("Error:", "Существует запись с такими значениями", ResultServiceStatusCode.ExsistItem);
|
||||
}
|
||||
|
||||
var entity = context.Set<T>().FirstOrDefault(x => x.Id == model.Id);
|
||||
if (entity == null)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound);
|
||||
}
|
||||
else if (entity.IsDeleted)
|
||||
{
|
||||
return OperationResultModel.Error("Error:", "Элемент был удален", ResultServiceStatusCode.WasDelete);
|
||||
}
|
||||
entity = Mapper.MapToClass(model, entity, true);
|
||||
|
||||
context.SaveChanges();
|
||||
|
||||
return OperationResultModel.Success(Mapper.MapToClass<T, E>(entity, true));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск записи с уникальными значениями
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract T GetUniqueEntity(S model, IQueryable<T> query);
|
||||
|
||||
/// <summary>
|
||||
/// Возможные дополнительные проверки при добавлении
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract OperationResultModel AdditionalCheckingWhenAdding(DbContext context, S model);
|
||||
|
||||
/// <summary>
|
||||
/// Возможные дополнительные проверки при удалении
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, T entity, G model);
|
||||
|
||||
/// <summary>
|
||||
/// Добавление дополнительных фильтров
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract IQueryable<T> AdditionalCheckingWhenReadingList(IQueryable<T> query, G model);
|
||||
|
||||
/// <summary>
|
||||
/// Возможные дополнительные проверки модели при изменении
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
protected abstract OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, S model);
|
||||
|
||||
/// <summary>
|
||||
/// Дополнительные удаления зависимых сущностей
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
protected abstract void AdditionalDeleting(DbContext context, T entity, G model);
|
||||
|
||||
/// <summary>
|
||||
/// Установка сортировок
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract IQueryable<T> OrderingWhenReading(IQueryable<T> query);
|
||||
|
||||
/// <summary>
|
||||
/// Добавление Include
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
protected abstract IQueryable<T> IncludingWhenReading(IQueryable<T> query);
|
||||
|
||||
/// <summary>
|
||||
/// Дополнительыне проверки, если требуется получать единичную запись но не по id
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual bool AdditionalCheckForSingleGet(G model) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Получение единичной записи но не по id
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual T GetSingleRecord(IQueryable<T> list, G model) => null;
|
||||
}
|
||||
}
|
21
DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj
Normal file
21
DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj
Normal file
@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.15" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.15" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.15">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CoreModels\CoreModels.csproj" />
|
||||
<ProjectReference Include="..\ToolsModule\ToolsModule.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
131
DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs
Normal file
131
DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs
Normal file
@ -0,0 +1,131 @@
|
||||
using CoreDatabase.Models.Department;
|
||||
using CoreDatabase.Models.Security;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CoreDatabase
|
||||
{
|
||||
public class DatabaseContext : DbContext
|
||||
{
|
||||
public DatabaseContext() : base() { }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
#if RELEASE
|
||||
var connectionString = ToolsModule.ManagmentDependency.ServiceProviderLoader.GetConfigData("connectionString");
|
||||
optionsBuilder.UseSqlServer(connectionString);
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
optionsBuilder.UseSqlServer(@"Data Source=CHESHIR\SQLEXPRESS;Initial Catalog=DepartmentDatabasePortal;persist security info=True;user id=admin;password=cheshirSA123;MultipleActiveResultSets=True;");
|
||||
#endif
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<EnviromentSetting>().HasIndex(s => s.Key).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Role>().HasIndex(s => s.RoleName).IsUnique();
|
||||
|
||||
modelBuilder.Entity<User>().HasIndex(s => s.UserName);
|
||||
|
||||
modelBuilder.Entity<Post>().HasIndex(s => s.PostName).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Employee>().HasIndex(d => new { d.FirstName, d.LastName, d.Patronymic }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Classroom>().HasIndex(d => new { d.Number }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<DisciplineBlock>().HasIndex(d => new { d.Title }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Discipline>().HasIndex(d => new { d.DisciplineName }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<LecturerAcademicDegree>().HasIndex(d => new { d.LecturerAcademicDegreeName }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<LecturerAcademicRank>().HasIndex(d => new { d.LecturerAcademicRankName }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Lecturer>().HasIndex(d => new { d.FirstName, d.LastName, d.Patronymic }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<EducationDirection>().HasIndex(d => new { d.Title, d.Profile }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<TimeNorm>().HasIndex(d => new { d.TimeNormName, d.TimeNormShortName }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<AcademicPlan>().HasIndex(d => new { d.EducationDirectionId, d.YearStart }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<AcademicPlanRecord>().HasIndex(d => new { d.AcademicPlanId, d.DisciplineId, d.Semester }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<AcademicPlanRecordTimeNormHour>().HasIndex(d => new { d.AcademicPlanRecordId, d.TimeNormId }).IsUnique();
|
||||
|
||||
// ругается на циклическое каскадное удаление, так что по нормам времени убираем ее
|
||||
modelBuilder.Entity<AcademicPlanRecordTimeNormHour>()
|
||||
.HasOne(x => x.TimeNorm)
|
||||
.WithMany(x => x.AcademicPlanRecordTimeNormHours)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
modelBuilder.Entity<StudentGroup>().HasIndex(d => new { d.AcademicPlanId, d.YearEntrance, d.GroupNumber }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Student>().HasIndex(d => new { d.NumberOfBook }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<Order>().HasIndex(d => new { d.OrderNumber, d.OrderDate, d.OrderType }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<OrderStudentRecord>().HasIndex(d => new { d.StudentId, d.OrderId }).IsUnique();
|
||||
|
||||
modelBuilder.Entity<OrderStudentRecord>()
|
||||
.HasOne(x => x.StudentGroupFrom)
|
||||
.WithMany(p => p.OrderStudentRecordFroms)
|
||||
.HasForeignKey(pt => pt.StudentGroupFromId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
modelBuilder.Entity<OrderStudentRecord>()
|
||||
.HasOne(x => x.StudentGroupTo)
|
||||
.WithMany(p => p.OrderStudentRecordTos)
|
||||
.HasForeignKey(pt => pt.StudentGroupToId)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
// ругается на циклическое каскадное удаление, так что по нормам времени убираем ее
|
||||
modelBuilder.Entity<OrderStudentRecord>()
|
||||
.HasOne(x => x.Student)
|
||||
.WithMany(x => x.OrderStudentRecords)
|
||||
.OnDelete(DeleteBehavior.NoAction);
|
||||
|
||||
modelBuilder.Entity<StudentMarkPassedDiscipline>().HasIndex(d => new { d.StudentId, d.DisciplineId, d.Semester, d.DisciplineReportingType, d.Mark }).IsUnique();
|
||||
}
|
||||
|
||||
#region Security
|
||||
public virtual DbSet<Access> Accesses { set; get; }
|
||||
public virtual DbSet<EnviromentSetting> EnviromentSettings { set; get; }
|
||||
public virtual DbSet<Role> Roles { set; get; }
|
||||
public virtual DbSet<User> Users { set; get; }
|
||||
public virtual DbSet<UserRole> UserRoles { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Department
|
||||
public virtual DbSet<Post> Posts { set; get; }
|
||||
public virtual DbSet<Employee> Employees { set; get; }
|
||||
public virtual DbSet<EmployeePost> EmployeePosts { set; get; }
|
||||
public virtual DbSet<Classroom> Classrooms { set; get; }
|
||||
public virtual DbSet<DisciplineBlock> DisciplineBlocks { set; get; }
|
||||
public virtual DbSet<Discipline> Disciplines { set; get; }
|
||||
public virtual DbSet<LecturerAcademicDegree> LecturerAcademicDegrees { set; get; }
|
||||
public virtual DbSet<LecturerAcademicRank> LecturerAcademicRanks { set; get; }
|
||||
public virtual DbSet<LecturerPost> LecturerPosts { set; get; }
|
||||
public virtual DbSet<Lecturer> Lecturers { set; get; }
|
||||
public virtual DbSet<EducationDirection> EducationDirections { set; get; }
|
||||
public virtual DbSet<TimeNorm> TimeNorms { set; get; }
|
||||
public virtual DbSet<AcademicPlan> AcademicPlans { set; get; }
|
||||
public virtual DbSet<AcademicPlanRecord> AcademicPlanRecords { set; get; }
|
||||
public virtual DbSet<AcademicPlanRecordTimeNormHour> AcademicPlanRecordTimeNormHours { set; get; }
|
||||
public virtual DbSet<StudentGroup> StudentGroups { set; get; }
|
||||
public virtual DbSet<Student> Students { set; get; }
|
||||
public virtual DbSet<Order> Orders { set; get; }
|
||||
public virtual DbSet<OrderStudentRecord> OrderStudentRecords { set; get; }
|
||||
public virtual DbSet<OrderSyncHistory> OrderSyncHistories { set; get; }
|
||||
public virtual DbSet<OrderSyncHistoryRecord> OrderSyncHistoryRecords { set; get; }
|
||||
public virtual DbSet<StudentMarkPassedDiscipline> StudentMarkPassedDisciplines { set; get; }
|
||||
public virtual DbSet<StudentMarkSyncHistory> StudentMarkSyncHistories { set; get; }
|
||||
public virtual DbSet<StudentMarkSyncHistoryRecord> StudentMarkSyncHistoryRecords { set; get; }
|
||||
#endregion
|
||||
}
|
||||
}
|
13
DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs
Normal file
13
DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace CoreDatabase
|
||||
{
|
||||
/// <summary>
|
||||
/// Работа с БД
|
||||
/// </summary>
|
||||
public static class DatabaseManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Получение объекта от класса DbContext
|
||||
/// </summary>
|
||||
public static DatabaseContext GetContext => new();
|
||||
}
|
||||
}
|
211
DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs
generated
Normal file
211
DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs
generated
Normal file
@ -0,0 +1,211 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210326072923_AddSecurityModels")]
|
||||
partial class AddSecurityModels
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
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<int>("Operation")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("Accesses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("EnviromentSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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(max)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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<DateTime?>("DateLocked")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsBanned")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("StudentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
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("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddSecurityModels : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EnviromentSettings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Key = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EnviromentSettings", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Roles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
RolePriority = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Roles", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
StudentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Avatar = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
DateLastVisit = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsBanned = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateBanned = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CountAttempt = table.Column<int>(type: "int", nullable: false),
|
||||
DateLocked = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Accesses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Operation = table.Column<int>(type: "int", nullable: false),
|
||||
AccessType = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Accesses", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Accesses_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserRoles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Accesses_RoleId",
|
||||
table: "Accesses",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserRoles_RoleId",
|
||||
table: "UserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserRoles_UserId",
|
||||
table: "UserRoles",
|
||||
column: "UserId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Accesses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EnviromentSettings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Roles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
217
DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs
generated
Normal file
217
DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs
generated
Normal file
@ -0,0 +1,217 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210327194001_ChangeSecurityFields")]
|
||||
partial class ChangeSecurityFields
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("EnviromentSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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(max)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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<Guid?>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsBanned")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("StudentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeSecurityFields : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DateLocked",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Operation",
|
||||
table: "Accesses",
|
||||
newName: "AccessOperation");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DateCreate",
|
||||
table: "UserRoles",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DateDelete",
|
||||
table: "UserRoles",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsDeleted",
|
||||
table: "UserRoles",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DateCreate",
|
||||
table: "UserRoles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DateDelete",
|
||||
table: "UserRoles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsDeleted",
|
||||
table: "UserRoles");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AccessOperation",
|
||||
table: "Accesses",
|
||||
newName: "Operation");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DateLocked",
|
||||
table: "Users",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,220 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210328165041_AddDescriptionInEnviromentSettings")]
|
||||
partial class AddDescriptionInEnviromentSettings
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("EnviromentSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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(max)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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<Guid?>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsBanned")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("StudentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddDescriptionInEnviromentSettings : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Description",
|
||||
table: "EnviromentSettings",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Description",
|
||||
table: "EnviromentSettings");
|
||||
}
|
||||
}
|
||||
}
|
216
DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs
generated
Normal file
216
DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs
generated
Normal file
@ -0,0 +1,216 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210401105731_UpdateSecurityModels")]
|
||||
partial class UpdateSecurityModels
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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(max)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateSecurityModels : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployeeId",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerId",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StudentId",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Value",
|
||||
table: "EnviromentSettings",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Key",
|
||||
table: "EnviromentSettings",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EnviromentSettings_Key",
|
||||
table: "EnviromentSettings",
|
||||
column: "Key",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EnviromentSettings_Key",
|
||||
table: "EnviromentSettings");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "EmployeeId",
|
||||
table: "Users",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LecturerId",
|
||||
table: "Users",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "StudentId",
|
||||
table: "Users",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Value",
|
||||
table: "EnviromentSettings",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Key",
|
||||
table: "EnviromentSettings",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
}
|
||||
}
|
||||
}
|
379
DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs
generated
Normal file
379
DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs
generated
Normal file
@ -0,0 +1,379 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210403054350_AddEmployee")]
|
||||
partial class AddEmployee
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsUnique()
|
||||
.HasFilter("[UserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddEmployee : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserName",
|
||||
table: "Users",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RoleName",
|
||||
table: "Roles",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeePosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeePostName = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Order = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeePosts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Employees",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Patronymic = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
DateBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
MobileNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
HomeNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Photo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
GroupElectricalSafety = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Employees", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeEmployeePosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeePostId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Rate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
IsInternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsExternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeEmployeePosts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeEmployeePosts_EmployeePosts_EmployeePostId",
|
||||
column: x => x.EmployeePostId,
|
||||
principalTable: "EmployeePosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeEmployeePosts_Employees_EmployeeId",
|
||||
column: x => x.EmployeeId,
|
||||
principalTable: "Employees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users",
|
||||
column: "UserName",
|
||||
filter: "[UserName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles",
|
||||
column: "RoleName",
|
||||
unique: true,
|
||||
filter: "[RoleName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeEmployeePosts_EmployeeId",
|
||||
table: "EmployeeEmployeePosts",
|
||||
column: "EmployeeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeEmployeePosts_EmployeePostId",
|
||||
table: "EmployeeEmployeePosts",
|
||||
column: "EmployeePostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeePosts_EmployeePostName",
|
||||
table: "EmployeePosts",
|
||||
column: "EmployeePostName",
|
||||
unique: true,
|
||||
filter: "[EmployeePostName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Employees_FirstName_LastName_Patronymic",
|
||||
table: "Employees",
|
||||
columns: new[] { "FirstName", "LastName", "Patronymic" },
|
||||
unique: true,
|
||||
filter: "[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeEmployeePosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Employees");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserName",
|
||||
table: "Users",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RoleName",
|
||||
table: "Roles",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
445
DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs
generated
Normal file
445
DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs
generated
Normal file
@ -0,0 +1,445 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210403090025_AddClassrooms")]
|
||||
partial class AddClassrooms
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddClassrooms : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Classrooms",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Number = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ClassroomType = table.Column<int>(type: "int", nullable: false),
|
||||
Square = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
Capacity = table.Column<int>(type: "int", nullable: false),
|
||||
SecurityCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
HaveProjector = table.Column<bool>(type: "bit", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Photo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Classrooms", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Classrooms_Employees_EmployeeId",
|
||||
column: x => x.EmployeeId,
|
||||
principalTable: "Employees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users",
|
||||
column: "UserName");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Classrooms_EmployeeId",
|
||||
table: "Classrooms",
|
||||
column: "EmployeeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Classrooms_Number",
|
||||
table: "Classrooms",
|
||||
column: "Number",
|
||||
unique: true,
|
||||
filter: "[Number] IS NOT NULL");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Classrooms");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UserName",
|
||||
table: "Users",
|
||||
column: "UserName",
|
||||
filter: "[UserName] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
535
DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs
generated
Normal file
535
DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs
generated
Normal file
@ -0,0 +1,535 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210403143118_AddDisciplines")]
|
||||
partial class AddDisciplines
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddDisciplines : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserName",
|
||||
table: "Users",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "PasswordHash",
|
||||
table: "Users",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RoleName",
|
||||
table: "Roles",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineBlocks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
DisciplineBlockUseForGrouping = table.Column<bool>(type: "bit", nullable: false),
|
||||
DisciplineBlockOrder = table.Column<int>(type: "int", nullable: false),
|
||||
DisciplineBlockBlueAsteriskName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineBlocks", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Disciplines",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DisciplineBlockId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DisciplineName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
DisciplineShortName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DisciplineBlueAsteriskName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Disciplines", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Disciplines_DisciplineBlocks_DisciplineBlockId",
|
||||
column: x => x.DisciplineBlockId,
|
||||
principalTable: "DisciplineBlocks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles",
|
||||
column: "RoleName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineBlocks_Title",
|
||||
table: "DisciplineBlocks",
|
||||
column: "Title",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Disciplines_DisciplineBlockId",
|
||||
table: "Disciplines",
|
||||
column: "DisciplineBlockId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Disciplines_DisciplineName",
|
||||
table: "Disciplines",
|
||||
column: "DisciplineName",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Disciplines");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineBlocks");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserName",
|
||||
table: "Users",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "PasswordHash",
|
||||
table: "Users",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RoleName",
|
||||
table: "Roles",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Roles_RoleName",
|
||||
table: "Roles",
|
||||
column: "RoleName",
|
||||
unique: true,
|
||||
filter: "[RoleName] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
829
DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs
generated
Normal file
829
DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs
generated
Normal file
@ -0,0 +1,829 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210403180333_AddLecturers")]
|
||||
partial class AddLecturers
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", 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>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany()
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddLecturers : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LecturerAcademicDegrees",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerAcademicDegreeName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Order = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LecturerAcademicDegrees", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LecturerAcademicRanks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerAcademicRankName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Order = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LecturerAcademicRanks", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LecturerPosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerPostName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Hours = table.Column<int>(type: "int", nullable: false),
|
||||
Order = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LecturerPosts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Lecturers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerPostId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerPostRate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
LecturerAcademicRankId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LecturerAcademicDegreeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Patronymic = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
DateBirth = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
MobileNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
HomeNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Photo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
GroupElectricalSafety = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Lecturers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Lecturers_LecturerAcademicDegrees_LecturerAcademicDegreeId",
|
||||
column: x => x.LecturerAcademicDegreeId,
|
||||
principalTable: "LecturerAcademicDegrees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Lecturers_LecturerAcademicRanks_LecturerAcademicRankId",
|
||||
column: x => x.LecturerAcademicRankId,
|
||||
principalTable: "LecturerAcademicRanks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Lecturers_LecturerPosts_LecturerPostId",
|
||||
column: x => x.LecturerPostId,
|
||||
principalTable: "LecturerPosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Lecturers_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LecturerEmployeePosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeePostId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Rate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
IsInternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsExternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LecturerEmployeePosts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LecturerEmployeePosts_EmployeePosts_EmployeePostId",
|
||||
column: x => x.EmployeePostId,
|
||||
principalTable: "EmployeePosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_LecturerEmployeePosts_Lecturers_LecturerId",
|
||||
column: x => x.LecturerId,
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Employees_UserId",
|
||||
table: "Employees",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerAcademicDegrees_LecturerAcademicDegreeName",
|
||||
table: "LecturerAcademicDegrees",
|
||||
column: "LecturerAcademicDegreeName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerAcademicRanks_LecturerAcademicRankName",
|
||||
table: "LecturerAcademicRanks",
|
||||
column: "LecturerAcademicRankName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerEmployeePosts_EmployeePostId",
|
||||
table: "LecturerEmployeePosts",
|
||||
column: "EmployeePostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerEmployeePosts_LecturerId",
|
||||
table: "LecturerEmployeePosts",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerPosts_LecturerPostName",
|
||||
table: "LecturerPosts",
|
||||
column: "LecturerPostName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_FirstName_LastName_Patronymic",
|
||||
table: "Lecturers",
|
||||
columns: new[] { "FirstName", "LastName", "Patronymic" },
|
||||
unique: true,
|
||||
filter: "[Patronymic] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_LecturerAcademicDegreeId",
|
||||
table: "Lecturers",
|
||||
column: "LecturerAcademicDegreeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_LecturerAcademicRankId",
|
||||
table: "Lecturers",
|
||||
column: "LecturerAcademicRankId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_LecturerPostId",
|
||||
table: "Lecturers",
|
||||
column: "LecturerPostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_UserId",
|
||||
table: "Lecturers",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Employees_Users_UserId",
|
||||
table: "Employees",
|
||||
column: "UserId",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Employees_Users_UserId",
|
||||
table: "Employees");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LecturerEmployeePosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Lecturers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LecturerAcademicDegrees");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LecturerAcademicRanks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Employees_UserId",
|
||||
table: "Employees");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,832 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210404053131_AddLecturerAcademicDegreeDiscription")]
|
||||
partial class AddLecturerAcademicDegreeDiscription
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany()
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddLecturerAcademicDegreeDiscription : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Description",
|
||||
table: "LecturerAcademicDegrees",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Description",
|
||||
table: "LecturerAcademicDegrees");
|
||||
}
|
||||
}
|
||||
}
|
835
DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs
generated
Normal file
835
DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs
generated
Normal file
@ -0,0 +1,835 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210404065039_AddDiciplineDescription")]
|
||||
partial class AddDiciplineDescription
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany()
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddDiciplineDescription : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Description",
|
||||
table: "Disciplines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Description",
|
||||
table: "Disciplines");
|
||||
}
|
||||
}
|
||||
}
|
838
DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs
generated
Normal file
838
DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs
generated
Normal file
@ -0,0 +1,838 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210404070556_AddLecturer")]
|
||||
partial class AddLecturer
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany()
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddLecturer : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Abbreviation",
|
||||
table: "Lecturers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Abbreviation",
|
||||
table: "Lecturers");
|
||||
}
|
||||
}
|
||||
}
|
841
DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs
generated
Normal file
841
DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs
generated
Normal file
@ -0,0 +1,841 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210404070734_AddLecturerOnlyForPrivate")]
|
||||
partial class AddLecturerOnlyForPrivate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany()
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany()
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddLecturerOnlyForPrivate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "OnlyForPrivate",
|
||||
table: "Lecturers",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlyForPrivate",
|
||||
table: "Lecturers");
|
||||
}
|
||||
}
|
||||
}
|
845
DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs
generated
Normal file
845
DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs
generated
Normal file
@ -0,0 +1,845 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210404170518_RemLecturerField")]
|
||||
partial class RemLecturerField
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("HomeNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("LecturerEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerEmployeePosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
|
||||
b.Navigation("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class RemLecturerField : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GroupElectricalSafety",
|
||||
table: "Lecturers");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "GroupElectricalSafety",
|
||||
table: "Lecturers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
854
DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs
generated
Normal file
854
DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs
generated
Normal file
@ -0,0 +1,854 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405060128_AddEnviromentSettingsFields")]
|
||||
partial class AddEnviromentSettingsFields
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.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("CoreDatabase.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("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("HomeNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("LecturerPostId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
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<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeePostId");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.ToTable("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerPostName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerPostName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("EmployeeEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerPostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("LecturerPost");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost")
|
||||
.WithMany("LecturerEmployeePosts")
|
||||
.HasForeignKey("EmployeePostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerEmployeePosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeePost");
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.Navigation("EmployeeEmployeePosts");
|
||||
|
||||
b.Navigation("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("LecturerEmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddEnviromentSettingsFields : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DateCreate",
|
||||
table: "EnviromentSettings",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DateDelete",
|
||||
table: "EnviromentSettings",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsDeleted",
|
||||
table: "EnviromentSettings",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DateCreate",
|
||||
table: "EnviromentSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DateDelete",
|
||||
table: "EnviromentSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsDeleted",
|
||||
table: "EnviromentSettings");
|
||||
}
|
||||
}
|
||||
}
|
810
DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs
generated
Normal file
810
DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs
generated
Normal file
@ -0,0 +1,810 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405080239_RemLecturerPost")]
|
||||
partial class RemLecturerPost
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.Models.Department.EmployeePost", 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<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("HomeNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", 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<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PostName")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PostName")
|
||||
.IsUnique()
|
||||
.HasFilter("[PostName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Posts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Navigation("EmployeePosts");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,419 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class RemLecturerPost : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Lecturers_LecturerPosts_LecturerPostId",
|
||||
table: "Lecturers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeEmployeePosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LecturerEmployeePosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Lecturers_LecturerPostId",
|
||||
table: "Lecturers");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_LecturerPosts_LecturerPostName",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EmployeePosts_EmployeePostName",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Hours",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerPostName",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Order",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployeePostName",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Order",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsExternalCombination",
|
||||
table: "LecturerPosts",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsInternalCombination",
|
||||
table: "LecturerPosts",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LecturerId",
|
||||
table: "LecturerPosts",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "PostId",
|
||||
table: "LecturerPosts",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "Rate",
|
||||
table: "LecturerPosts",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "EmployeeId",
|
||||
table: "EmployeePosts",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsExternalCombination",
|
||||
table: "EmployeePosts",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsInternalCombination",
|
||||
table: "EmployeePosts",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "PostId",
|
||||
table: "EmployeePosts",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "Rate",
|
||||
table: "EmployeePosts",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Posts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PostName = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Hours = table.Column<int>(type: "int", nullable: true),
|
||||
Order = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Posts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerPosts_LecturerId",
|
||||
table: "LecturerPosts",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerPosts_PostId",
|
||||
table: "LecturerPosts",
|
||||
column: "PostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeePosts_EmployeeId",
|
||||
table: "EmployeePosts",
|
||||
column: "EmployeeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeePosts_PostId",
|
||||
table: "EmployeePosts",
|
||||
column: "PostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Posts_PostName",
|
||||
table: "Posts",
|
||||
column: "PostName",
|
||||
unique: true,
|
||||
filter: "[PostName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EmployeePosts_Employees_EmployeeId",
|
||||
table: "EmployeePosts",
|
||||
column: "EmployeeId",
|
||||
principalTable: "Employees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EmployeePosts_Posts_PostId",
|
||||
table: "EmployeePosts",
|
||||
column: "PostId",
|
||||
principalTable: "Posts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_LecturerPosts_Lecturers_LecturerId",
|
||||
table: "LecturerPosts",
|
||||
column: "LecturerId",
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_LecturerPosts_Posts_PostId",
|
||||
table: "LecturerPosts",
|
||||
column: "PostId",
|
||||
principalTable: "Posts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EmployeePosts_Employees_EmployeeId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EmployeePosts_Posts_PostId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_LecturerPosts_Lecturers_LecturerId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_LecturerPosts_Posts_PostId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Posts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_LecturerPosts_LecturerId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_LecturerPosts_PostId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EmployeePosts_EmployeeId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EmployeePosts_PostId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsExternalCombination",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsInternalCombination",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PostId",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Rate",
|
||||
table: "LecturerPosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployeeId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsExternalCombination",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsInternalCombination",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PostId",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Rate",
|
||||
table: "EmployeePosts");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Hours",
|
||||
table: "LecturerPosts",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LecturerPostName",
|
||||
table: "LecturerPosts",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Order",
|
||||
table: "LecturerPosts",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "EmployeePostName",
|
||||
table: "EmployeePosts",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Order",
|
||||
table: "EmployeePosts",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeEmployeePosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
EmployeeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeePostId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsExternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsInternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
Rate = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeEmployeePosts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeEmployeePosts_EmployeePosts_EmployeePostId",
|
||||
column: x => x.EmployeePostId,
|
||||
principalTable: "EmployeePosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeEmployeePosts_Employees_EmployeeId",
|
||||
column: x => x.EmployeeId,
|
||||
principalTable: "Employees",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LecturerEmployeePosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
EmployeePostId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsExternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsInternalCombination = table.Column<bool>(type: "bit", nullable: false),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Rate = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LecturerEmployeePosts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LecturerEmployeePosts_EmployeePosts_EmployeePostId",
|
||||
column: x => x.EmployeePostId,
|
||||
principalTable: "EmployeePosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_LecturerEmployeePosts_Lecturers_LecturerId",
|
||||
column: x => x.LecturerId,
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lecturers_LecturerPostId",
|
||||
table: "Lecturers",
|
||||
column: "LecturerPostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerPosts_LecturerPostName",
|
||||
table: "LecturerPosts",
|
||||
column: "LecturerPostName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeePosts_EmployeePostName",
|
||||
table: "EmployeePosts",
|
||||
column: "EmployeePostName",
|
||||
unique: true,
|
||||
filter: "[EmployeePostName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeEmployeePosts_EmployeeId",
|
||||
table: "EmployeeEmployeePosts",
|
||||
column: "EmployeeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeEmployeePosts_EmployeePostId",
|
||||
table: "EmployeeEmployeePosts",
|
||||
column: "EmployeePostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerEmployeePosts_EmployeePostId",
|
||||
table: "LecturerEmployeePosts",
|
||||
column: "EmployeePostId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LecturerEmployeePosts_LecturerId",
|
||||
table: "LecturerEmployeePosts",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Lecturers_LecturerPosts_LecturerPostId",
|
||||
table: "Lecturers",
|
||||
column: "LecturerPostId",
|
||||
principalTable: "LecturerPosts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
813
DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs
generated
Normal file
813
DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs
generated
Normal file
@ -0,0 +1,813 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405082110_AddFieldToLecturer")]
|
||||
partial class AddFieldToLecturer
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.Models.Department.EmployeePost", 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<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("LecturerPostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("LecturerPostRate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", 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<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PostName")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PostName")
|
||||
.IsUnique()
|
||||
.HasFilter("[PostName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Posts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Navigation("EmployeePosts");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddFieldToLecturer : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "GroupElectricalSafety",
|
||||
table: "Lecturers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GroupElectricalSafety",
|
||||
table: "Lecturers");
|
||||
}
|
||||
}
|
||||
}
|
807
DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs
generated
Normal file
807
DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs
generated
Normal file
@ -0,0 +1,807 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405082213_RemFieldToLecturer")]
|
||||
partial class RemFieldToLecturer
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique()
|
||||
.HasFilter("[Number] IS NOT NULL");
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.Models.Department.EmployeePost", 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<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", 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<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PostName")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PostName")
|
||||
.IsUnique()
|
||||
.HasFilter("[PostName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Posts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Navigation("EmployeePosts");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class RemFieldToLecturer : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerPostId",
|
||||
table: "Lecturers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerPostRate",
|
||||
table: "Lecturers");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LecturerPostId",
|
||||
table: "Lecturers",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "LecturerPostRate",
|
||||
table: "Lecturers",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
}
|
||||
}
|
||||
}
|
870
DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs
generated
Normal file
870
DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs
generated
Normal file
@ -0,0 +1,870 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405091403_AddEducationDirection")]
|
||||
partial class AddEducationDirection
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cipher")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Profile")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("Qualification")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("Title", "Profile")
|
||||
.IsUnique()
|
||||
.HasFilter("[Profile] IS NOT NULL");
|
||||
|
||||
b.ToTable("EducationDirections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.Models.Department.EmployeePost", 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<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", 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<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PostName")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PostName")
|
||||
.IsUnique()
|
||||
.HasFilter("[PostName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Posts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("EducationDirections")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("EducationDirections");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Navigation("EmployeePosts");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddEducationDirection : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Classrooms_Number",
|
||||
table: "Classrooms");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Number",
|
||||
table: "Classrooms",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EducationDirections",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Cipher = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ShortName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Profile = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
Qualification = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EducationDirections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EducationDirections_Lecturers_LecturerId",
|
||||
column: x => x.LecturerId,
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Classrooms_Number",
|
||||
table: "Classrooms",
|
||||
column: "Number",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EducationDirections_LecturerId",
|
||||
table: "EducationDirections",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EducationDirections_Title_Profile",
|
||||
table: "EducationDirections",
|
||||
columns: new[] { "Title", "Profile" },
|
||||
unique: true,
|
||||
filter: "[Profile] IS NOT NULL");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EducationDirections");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Classrooms_Number",
|
||||
table: "Classrooms");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Number",
|
||||
table: "Classrooms",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Classrooms_Number",
|
||||
table: "Classrooms",
|
||||
column: "Number",
|
||||
unique: true,
|
||||
filter: "[Number] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
869
DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs
generated
Normal file
869
DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs
generated
Normal file
@ -0,0 +1,869 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using CoreDatabase;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20210405095913_UPdFieldEducationDirection")]
|
||||
partial class UPdFieldEducationDirection
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.4")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Capacity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClassroomType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("EmployeeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("HaveProjector")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Number")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<byte[]>("Photo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("SecurityCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<decimal>("Square")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("Number")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Classrooms");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("DisciplineBlockId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("DisciplineBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisciplineName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("DisciplineShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineBlockId");
|
||||
|
||||
b.HasIndex("DisciplineName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DisciplineBlockBlueAsteriskName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("DisciplineBlockOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("DisciplineBlockUseForGrouping")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Title")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DisciplineBlocks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cipher")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Profile")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Qualification")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("Title", "Profile")
|
||||
.IsUnique()
|
||||
.HasFilter("[Profile] IS NOT NULL");
|
||||
|
||||
b.ToTable("EducationDirections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("UserId");
|
||||
|
||||
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("CoreDatabase.Models.Department.EmployeePost", 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<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Abbreviation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicDegreeId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("LecturerAcademicRankId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("MobileNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("OnlyForPrivate")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("FirstName", "LastName", "Patronymic")
|
||||
.IsUnique()
|
||||
.HasFilter("[Patronymic] IS NOT NULL");
|
||||
|
||||
b.ToTable("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LecturerAcademicDegreeName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicDegreeName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicDegrees");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", 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>("LecturerAcademicRankName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerAcademicRankName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("LecturerAcademicRanks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", 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<bool>("IsExternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInternalCombination")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid>("LecturerId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("PostId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Rate")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LecturerId");
|
||||
|
||||
b.HasIndex("PostId");
|
||||
|
||||
b.ToTable("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("Hours")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PostName")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PostName")
|
||||
.IsUnique()
|
||||
.HasFilter("[PostName] IS NOT NULL");
|
||||
|
||||
b.ToTable("Posts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Security.EnviromentSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateDelete")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
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("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("RolePriority")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleName")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserName");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.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("CoreDatabase.Models.Department.Classroom", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("Classrooms")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
|
||||
.WithMany("Disciplines")
|
||||
.HasForeignKey("DisciplineBlockId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineBlock");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("EducationDirections")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Employees")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Employee", "Employee")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("EmployeeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("EmployeePosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Employee");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicDegreeId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("LecturerAcademicRankId");
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("Lecturers")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LecturerAcademicDegree");
|
||||
|
||||
b.Navigation("LecturerAcademicRank");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("LecturerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Department.Post", "Post")
|
||||
.WithMany("LecturerPosts")
|
||||
.HasForeignKey("PostId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Lecturer");
|
||||
|
||||
b.Navigation("Post");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Access", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("Access")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b =>
|
||||
{
|
||||
b.HasOne("CoreDatabase.Models.Security.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CoreDatabase.Models.Security.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b =>
|
||||
{
|
||||
b.Navigation("Disciplines");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b =>
|
||||
{
|
||||
b.Navigation("Classrooms");
|
||||
|
||||
b.Navigation("EmployeePosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b =>
|
||||
{
|
||||
b.Navigation("EducationDirections");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b =>
|
||||
{
|
||||
b.Navigation("Lecturers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Department.Post", b =>
|
||||
{
|
||||
b.Navigation("EmployeePosts");
|
||||
|
||||
b.Navigation("LecturerPosts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.Role", b =>
|
||||
{
|
||||
b.Navigation("Access");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CoreDatabase.Models.Security.User", b =>
|
||||
{
|
||||
b.Navigation("Employees");
|
||||
|
||||
b.Navigation("Lecturers");
|
||||
|
||||
b.Navigation("UserRoles");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UPdFieldEducationDirection : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Qualification",
|
||||
table: "EducationDirections",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Qualification",
|
||||
table: "EducationDirections",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
}
|
||||
}
|
||||
}
|
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs
generated
Normal file
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,183 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddAcademicPlans : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AcademicPlans",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EducationDirectionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
YearEntrance = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
YearFinish = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AcademicPlans", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AcademicPlans_EducationDirections_EducationDirectionId",
|
||||
column: x => x.EducationDirectionId,
|
||||
principalTable: "EducationDirections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TimeNorms",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DisciplineBlockId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TimeNormName = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
TimeNormShortName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TimeNormOrder = table.Column<int>(type: "int", nullable: false),
|
||||
TimeNormEducationDirectionQualification = table.Column<int>(type: "int", nullable: true),
|
||||
KindOfLoadName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
KindOfLoadAttributeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
KindOfLoadBlueAsteriskName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
KindOfLoadBlueAsteriskAttributeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
KindOfLoadBlueAsteriskPracticName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UseInLearningProgress = table.Column<bool>(type: "bit", nullable: false),
|
||||
UseInSite = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TimeNorms", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TimeNorms_DisciplineBlocks_DisciplineBlockId",
|
||||
column: x => x.DisciplineBlockId,
|
||||
principalTable: "DisciplineBlocks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AcademicPlanRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
AcademicPlanId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DisciplineId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
InDepartment = table.Column<bool>(type: "bit", nullable: false),
|
||||
Semester = table.Column<int>(type: "int", nullable: false),
|
||||
Zet = table.Column<int>(type: "int", nullable: false),
|
||||
AcademicPlanRecordParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsParent = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsFacultative = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AcademicPlanRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AcademicPlanRecords_AcademicPlans_AcademicPlanId",
|
||||
column: x => x.AcademicPlanId,
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AcademicPlanRecords_Disciplines_DisciplineId",
|
||||
column: x => x.DisciplineId,
|
||||
principalTable: "Disciplines",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AcademicPlanRecordTimeNormHours",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
AcademicPlanRecordId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TimeNormId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PlanHours = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AcademicPlanRecordTimeNormHours", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_AcademicPlanRecords_AcademicPlanRecordId",
|
||||
column: x => x.AcademicPlanRecordId,
|
||||
principalTable: "AcademicPlanRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
column: x => x.TimeNormId,
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlanRecords_AcademicPlanId_DisciplineId_Semester",
|
||||
table: "AcademicPlanRecords",
|
||||
columns: new[] { "AcademicPlanId", "DisciplineId", "Semester" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlanRecords_DisciplineId",
|
||||
table: "AcademicPlanRecords",
|
||||
column: "DisciplineId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlanRecordTimeNormHours_AcademicPlanRecordId_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
columns: new[] { "AcademicPlanRecordId", "TimeNormId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlanRecordTimeNormHours_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TimeNorms_DisciplineBlockId",
|
||||
table: "TimeNorms",
|
||||
column: "DisciplineBlockId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TimeNorms_TimeNormName",
|
||||
table: "TimeNorms",
|
||||
column: "TimeNormName",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AcademicPlanRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TimeNorms");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AcademicPlans");
|
||||
}
|
||||
}
|
||||
}
|
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs
generated
Normal file
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,72 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdUniqueTimeNorm : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TimeNorms_TimeNormName",
|
||||
table: "TimeNorms");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TimeNormShortName",
|
||||
table: "TimeNorms",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TimeNorms_TimeNormName_TimeNormShortName",
|
||||
table: "TimeNorms",
|
||||
columns: new[] { "TimeNormName", "TimeNormShortName" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TimeNorms_TimeNormName_TimeNormShortName",
|
||||
table: "TimeNorms");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "TimeNormShortName",
|
||||
table: "TimeNorms",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TimeNorms_TimeNormName",
|
||||
table: "TimeNorms",
|
||||
column: "TimeNormName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs
generated
Normal file
1131
DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeTypeInacademicPlan : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
1130
DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs
generated
Normal file
1130
DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeAcademPlan : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlans_EducationDirections_EducationDirectionId",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "EducationDirectionId",
|
||||
table: "AcademicPlans",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true,
|
||||
filter: "[EducationDirectionId] IS NOT NULL");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlans_EducationDirections_EducationDirectionId",
|
||||
table: "AcademicPlans",
|
||||
column: "EducationDirectionId",
|
||||
principalTable: "EducationDirections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlans_EducationDirections_EducationDirectionId",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "EducationDirectionId",
|
||||
table: "AcademicPlans",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlans_EducationDirections_EducationDirectionId",
|
||||
table: "AcademicPlans",
|
||||
column: "EducationDirectionId",
|
||||
principalTable: "EducationDirections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
1187
DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs
generated
Normal file
1187
DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddStudentGroups : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StudentGroups",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
AcademicPlanId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
GroupNumber = table.Column<int>(type: "int", nullable: false),
|
||||
EnrollmentYear = table.Column<int>(type: "int", nullable: false),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StudentGroups", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_StudentGroups_AcademicPlans_AcademicPlanId",
|
||||
column: x => x.AcademicPlanId,
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_StudentGroups_Lecturers_LecturerId",
|
||||
column: x => x.LecturerId,
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentGroups_AcademicPlanId_EnrollmentYear_GroupNumber",
|
||||
table: "StudentGroups",
|
||||
columns: new[] { "AcademicPlanId", "EnrollmentYear", "GroupNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentGroups_LecturerId",
|
||||
table: "StudentGroups",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "StudentGroups");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId",
|
||||
table: "AcademicPlanRecordTimeNormHours",
|
||||
column: "TimeNormId",
|
||||
principalTable: "TimeNorms",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
1276
DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs
generated
Normal file
1276
DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddStudents : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Students",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
StudentGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
NumberOfBook = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Patronymic = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
StudentState = table.Column<int>(type: "int", nullable: false),
|
||||
Photo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
IsSteward = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Students", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Students_StudentGroups_StudentGroupId",
|
||||
column: x => x.StudentGroupId,
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Students_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_NumberOfBook",
|
||||
table: "Students",
|
||||
column: "NumberOfBook",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_StudentGroupId",
|
||||
table: "Students",
|
||||
column: "StudentGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_UserId",
|
||||
table: "Students",
|
||||
column: "UserId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Students");
|
||||
}
|
||||
}
|
||||
}
|
1401
DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs
generated
Normal file
1401
DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddOrders : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Orders",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
OrderNumber = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
OrderDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
OrderType = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Orders", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OrderStudentRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
OrderId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
StudentGroupFromId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
StudentGroupToId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
OrderStudentMoveType = table.Column<int>(type: "int", nullable: false),
|
||||
Info = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_OrderStudentRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_OrderStudentRecords_Orders_OrderId",
|
||||
column: x => x.OrderId,
|
||||
principalTable: "Orders",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupFromId",
|
||||
column: x => x.StudentGroupFromId,
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupToId",
|
||||
column: x => x.StudentGroupToId,
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
table.ForeignKey(
|
||||
name: "FK_OrderStudentRecords_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Orders_OrderNumber",
|
||||
table: "Orders",
|
||||
column: "OrderNumber",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OrderStudentRecords_OrderId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "OrderId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OrderStudentRecords_StudentGroupFromId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentGroupFromId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OrderStudentRecords_StudentGroupToId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentGroupToId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OrderStudentRecords_StudentId_OrderId",
|
||||
table: "OrderStudentRecords",
|
||||
columns: new[] { "StudentId", "OrderId" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderStudentRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Orders");
|
||||
}
|
||||
}
|
||||
}
|
1449
DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs
generated
Normal file
1449
DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddOrderSyncHistories : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupToId",
|
||||
table: "OrderStudentRecords");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_OrderStudentRecords_Students_StudentId",
|
||||
table: "OrderStudentRecords");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OrderSyncHistories",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SyncDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_OrderSyncHistories", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OrderSyncHistoryRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
OrderSyncHistoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Information = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_OrderSyncHistoryRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_OrderSyncHistoryRecords_OrderSyncHistories_OrderSyncHistoryId",
|
||||
column: x => x.OrderSyncHistoryId,
|
||||
principalTable: "OrderSyncHistories",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OrderSyncHistoryRecords_OrderSyncHistoryId",
|
||||
table: "OrderSyncHistoryRecords",
|
||||
column: "OrderSyncHistoryId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupToId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentGroupToId",
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_OrderStudentRecords_Students_StudentId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentId",
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupToId",
|
||||
table: "OrderStudentRecords");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_OrderStudentRecords_Students_StudentId",
|
||||
table: "OrderStudentRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderSyncHistoryRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderSyncHistories");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_OrderStudentRecords_StudentGroups_StudentGroupToId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentGroupToId",
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_OrderStudentRecords_Students_StudentId",
|
||||
table: "OrderStudentRecords",
|
||||
column: "StudentId",
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
1450
DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs
generated
Normal file
1450
DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeStudentGroups : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_StudentGroups_AcademicPlans_AcademicPlanId",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "EnrollmentYear",
|
||||
table: "StudentGroups",
|
||||
newName: "AcademicCourse");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AcademicPlanId",
|
||||
table: "StudentGroups",
|
||||
newName: "EducationDirectionId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_StudentGroups_AcademicPlanId_EnrollmentYear_GroupNumber",
|
||||
table: "StudentGroups",
|
||||
newName: "IX_StudentGroups_EducationDirectionId_AcademicCourse_GroupNumber");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_StudentGroups_EducationDirections_EducationDirectionId",
|
||||
table: "StudentGroups",
|
||||
column: "EducationDirectionId",
|
||||
principalTable: "EducationDirections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.NoAction);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_StudentGroups_EducationDirections_EducationDirectionId",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "EducationDirectionId",
|
||||
table: "StudentGroups",
|
||||
newName: "AcademicPlanId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AcademicCourse",
|
||||
table: "StudentGroups",
|
||||
newName: "EnrollmentYear");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_StudentGroups_EducationDirectionId_AcademicCourse_GroupNumber",
|
||||
table: "StudentGroups",
|
||||
newName: "IX_StudentGroups_AcademicPlanId_EnrollmentYear_GroupNumber");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_StudentGroups_AcademicPlans_AcademicPlanId",
|
||||
table: "StudentGroups",
|
||||
column: "AcademicPlanId",
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
1454
DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs
generated
Normal file
1454
DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateStudnet : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Iduniv",
|
||||
table: "Students",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Iduniv",
|
||||
table: "Students");
|
||||
}
|
||||
}
|
||||
}
|
1453
DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs
generated
Normal file
1453
DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateStudnet2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Students",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Students",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
1450
DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs
generated
Normal file
1450
DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateStudnet3 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_StudentGroups_StudentGroupId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StudentGroupId",
|
||||
table: "Students",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_StudentGroups_StudentGroupId",
|
||||
table: "Students",
|
||||
column: "StudentGroupId",
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_StudentGroups_StudentGroupId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StudentGroupId",
|
||||
table: "Students",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uniqueidentifier",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_StudentGroups_StudentGroupId",
|
||||
table: "Students",
|
||||
column: "StudentGroupId",
|
||||
principalTable: "StudentGroups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
1508
DepartmentPortal/Common/CoreDatabase/Migrations/20220326210022_AddEnrollmentYear.Designer.cs
generated
Normal file
1508
DepartmentPortal/Common/CoreDatabase/Migrations/20220326210022_AddEnrollmentYear.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddEnrollmentYear : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "EnrollmentYearId",
|
||||
table: "Students",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "CreateDate",
|
||||
table: "AcademicPlans",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastUpdateDate",
|
||||
table: "AcademicPlans",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
//требуется для создания уникального индекса IX_AcademicPlans_EducationDirectionId_CreateDate, если уже есть записи в AcademicPlans
|
||||
migrationBuilder.Sql(
|
||||
@"
|
||||
declare @i int = 45869
|
||||
UPDATE AcademicPlans
|
||||
SET CreateDate = convert(datetime, @i),
|
||||
SET LastUpdateDate = convert(datetime, @i),
|
||||
@i = @i + 100;
|
||||
");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EnrollmentYears",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
AcademicPlanId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
YearEntrance = table.Column<int>(type: "int", nullable: false),
|
||||
YearFinish = table.Column<int>(type: "int", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EnrollmentYears", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EnrollmentYears_AcademicPlans_AcademicPlanId",
|
||||
column: x => x.AcademicPlanId,
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_EnrollmentYearId",
|
||||
table: "Students",
|
||||
column: "EnrollmentYearId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_CreateDate",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "CreateDate" },
|
||||
unique: true,
|
||||
filter: "[EducationDirectionId] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EnrollmentYears_AcademicPlanId_YearEntrance",
|
||||
table: "EnrollmentYears",
|
||||
columns: new[] { "AcademicPlanId", "YearEntrance" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_EnrollmentYears_EnrollmentYearId",
|
||||
table: "Students",
|
||||
column: "EnrollmentYearId",
|
||||
principalTable: "EnrollmentYears",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_EnrollmentYears_EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EnrollmentYears");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Students_EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_CreateDate",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateDate",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastUpdateDate",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearFinish",
|
||||
table: "AcademicPlans",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearEntrance",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearEntrance" },
|
||||
unique: true,
|
||||
filter: "[EducationDirectionId] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
1581
DepartmentPortal/Common/CoreDatabase/Migrations/20220327102136_AddBasicDepartments.Designer.cs
generated
Normal file
1581
DepartmentPortal/Common/CoreDatabase/Migrations/20220327102136_AddBasicDepartments.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddBasicDepartments : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "BasicDepartmentId",
|
||||
table: "Students",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "BasicDepartmentId",
|
||||
table: "Disciplines",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BasicDepartment",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
LecturerId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
BasicDepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
BasicDepartmentDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
EnterprisesName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BasicDepartment", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BasicDepartment_Lecturers_LecturerId",
|
||||
column: x => x.LecturerId,
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_BasicDepartmentId",
|
||||
table: "Students",
|
||||
column: "BasicDepartmentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Disciplines_BasicDepartmentId",
|
||||
table: "Disciplines",
|
||||
column: "BasicDepartmentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BasicDepartment_LecturerId",
|
||||
table: "BasicDepartment",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Disciplines_BasicDepartment_BasicDepartmentId",
|
||||
table: "Disciplines",
|
||||
column: "BasicDepartmentId",
|
||||
principalTable: "BasicDepartment",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_BasicDepartment_BasicDepartmentId",
|
||||
table: "Students",
|
||||
column: "BasicDepartmentId",
|
||||
principalTable: "BasicDepartment",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Disciplines_BasicDepartment_BasicDepartmentId",
|
||||
table: "Disciplines");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_BasicDepartment_BasicDepartmentId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BasicDepartment");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Students_BasicDepartmentId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Disciplines_BasicDepartmentId",
|
||||
table: "Disciplines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BasicDepartmentId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BasicDepartmentId",
|
||||
table: "Disciplines");
|
||||
}
|
||||
}
|
||||
}
|
1581
DepartmentPortal/Common/CoreDatabase/Migrations/20220329053045_ChangeOrderIndexUnique.Designer.cs
generated
Normal file
1581
DepartmentPortal/Common/CoreDatabase/Migrations/20220329053045_ChangeOrderIndexUnique.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeOrderIndexUnique : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Orders_OrderNumber",
|
||||
table: "Orders");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Orders_OrderNumber_OrderDate_OrderType",
|
||||
table: "Orders",
|
||||
columns: new[] { "OrderNumber", "OrderDate", "OrderType" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Orders_OrderNumber_OrderDate_OrderType",
|
||||
table: "Orders");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Orders_OrderNumber",
|
||||
table: "Orders",
|
||||
column: "OrderNumber",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
1526
DepartmentPortal/Common/CoreDatabase/Migrations/20221214163806_ChangeStudentGroupLogic.Designer.cs
generated
Normal file
1526
DepartmentPortal/Common/CoreDatabase/Migrations/20221214163806_ChangeStudentGroupLogic.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class ChangeStudentGroupLogic : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_StudentGroups_EducationDirections_EducationDirectionId",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Students_EnrollmentYears_EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EnrollmentYears");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Students_EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_StudentGroups_EducationDirectionId_AcademicCourse_GroupNumber",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EnrollmentYearId",
|
||||
table: "Students");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "EducationDirectionId",
|
||||
table: "StudentGroups",
|
||||
newName: "AcademicPlanId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AcademicCourse",
|
||||
table: "StudentGroups",
|
||||
newName: "YearFinish");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearEntrance",
|
||||
table: "StudentGroups",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentGroups_AcademicPlanId_YearEntrance_GroupNumber",
|
||||
table: "StudentGroups",
|
||||
columns: new[] { "AcademicPlanId", "YearEntrance", "GroupNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_StudentGroups_AcademicPlans_AcademicPlanId",
|
||||
table: "StudentGroups",
|
||||
column: "AcademicPlanId",
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_StudentGroups_AcademicPlans_AcademicPlanId",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_StudentGroups_AcademicPlanId_YearEntrance_GroupNumber",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearEntrance",
|
||||
table: "StudentGroups");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "YearFinish",
|
||||
table: "StudentGroups",
|
||||
newName: "AcademicCourse");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "AcademicPlanId",
|
||||
table: "StudentGroups",
|
||||
newName: "EducationDirectionId");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "EnrollmentYearId",
|
||||
table: "Students",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EnrollmentYears",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
AcademicPlanId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
YearEntrance = table.Column<int>(type: "int", nullable: false),
|
||||
YearFinish = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EnrollmentYears", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EnrollmentYears_AcademicPlans_AcademicPlanId",
|
||||
column: x => x.AcademicPlanId,
|
||||
principalTable: "AcademicPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Students_EnrollmentYearId",
|
||||
table: "Students",
|
||||
column: "EnrollmentYearId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentGroups_EducationDirectionId_AcademicCourse_GroupNumber",
|
||||
table: "StudentGroups",
|
||||
columns: new[] { "EducationDirectionId", "AcademicCourse", "GroupNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EnrollmentYears_AcademicPlanId_YearEntrance",
|
||||
table: "EnrollmentYears",
|
||||
columns: new[] { "AcademicPlanId", "YearEntrance" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_StudentGroups_EducationDirections_EducationDirectionId",
|
||||
table: "StudentGroups",
|
||||
column: "EducationDirectionId",
|
||||
principalTable: "EducationDirections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Students_EnrollmentYears_EnrollmentYearId",
|
||||
table: "Students",
|
||||
column: "EnrollmentYearId",
|
||||
principalTable: "EnrollmentYears",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
1526
DepartmentPortal/Common/CoreDatabase/Migrations/20221215062113_UpdateAcademicPlanSetYearStart.Designer.cs
generated
Normal file
1526
DepartmentPortal/Common/CoreDatabase/Migrations/20221215062113_UpdateAcademicPlanSetYearStart.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateAcademicPlanSetYearStart : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_CreateDate",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "YearStart",
|
||||
table: "AcademicPlans",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
//требуется для создания уникального индекса IX_AcademicPlans_EducationDirectionId_YearStart, если уже есть записи в AcademicPlans
|
||||
migrationBuilder.Sql(
|
||||
@"
|
||||
UPDATE AcademicPlans
|
||||
SET YearStart = YEAR(CreateDate)
|
||||
");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateDate",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearStart",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "YearStart" },
|
||||
unique: true,
|
||||
filter: "[EducationDirectionId] IS NOT NULL");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_YearStart",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "YearStart",
|
||||
table: "AcademicPlans");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "CreateDate",
|
||||
table: "AcademicPlans",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AcademicPlans_EducationDirectionId_CreateDate",
|
||||
table: "AcademicPlans",
|
||||
columns: new[] { "EducationDirectionId", "CreateDate" },
|
||||
unique: true,
|
||||
filter: "[EducationDirectionId] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
1594
DepartmentPortal/Common/CoreDatabase/Migrations/20221220182036_AddStudentMarkPassedDiscipline.Designer.cs
generated
Normal file
1594
DepartmentPortal/Common/CoreDatabase/Migrations/20221220182036_AddStudentMarkPassedDiscipline.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddStudentMarkPassedDiscipline : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StudentMarkPassedDisciplines",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DisciplineId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Semester = table.Column<int>(type: "int", nullable: false),
|
||||
Mark = table.Column<int>(type: "int", nullable: false),
|
||||
DateAffixing = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
IsIncreaseMark = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsDirection = table.Column<bool>(type: "bit", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateDelete = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StudentMarkPassedDisciplines", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_StudentMarkPassedDisciplines_Disciplines_DisciplineId",
|
||||
column: x => x.DisciplineId,
|
||||
principalTable: "Disciplines",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_StudentMarkPassedDisciplines_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_DisciplineId",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
column: "DisciplineId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_StudentId_DisciplineId_Semester_Mark",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
columns: new[] { "StudentId", "DisciplineId", "Semester", "Mark" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "StudentMarkPassedDisciplines");
|
||||
}
|
||||
}
|
||||
}
|
1642
DepartmentPortal/Common/CoreDatabase/Migrations/20221221054847_AddStudentMarkSyncHistory.Designer.cs
generated
Normal file
1642
DepartmentPortal/Common/CoreDatabase/Migrations/20221221054847_AddStudentMarkSyncHistory.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class AddStudentMarkSyncHistory : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StudentMarkSyncHistories",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SyncDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StudentMarkSyncHistories", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StudentMarkSyncHistoryRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
StudentMarkSyncHistoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Information = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StudentMarkSyncHistoryRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_StudentMarkSyncHistoryRecords_StudentMarkSyncHistories_StudentMarkSyncHistoryId",
|
||||
column: x => x.StudentMarkSyncHistoryId,
|
||||
principalTable: "StudentMarkSyncHistories",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkSyncHistoryRecords_StudentMarkSyncHistoryId",
|
||||
table: "StudentMarkSyncHistoryRecords",
|
||||
column: "StudentMarkSyncHistoryId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "StudentMarkSyncHistoryRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "StudentMarkSyncHistories");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace CoreDatabase.Migrations
|
||||
{
|
||||
public partial class UpdateStudentMarkPassedDisciplineModel : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_StudentId_DisciplineId_Semester_Mark",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AddiionalInfo",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DisciplineReportingType",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LecturerId",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_LecturerId",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
column: "LecturerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_StudentId_DisciplineId_Semester_DisciplineReportingType_Mark",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
columns: new[] { "StudentId", "DisciplineId", "Semester", "DisciplineReportingType", "Mark" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_StudentMarkPassedDisciplines_Lecturers_LecturerId",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
column: "LecturerId",
|
||||
principalTable: "Lecturers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_StudentMarkPassedDisciplines_Lecturers_LecturerId",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_LecturerId",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_StudentId_DisciplineId_Semester_DisciplineReportingType_Mark",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AddiionalInfo",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineReportingType",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LecturerId",
|
||||
table: "StudentMarkPassedDisciplines");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_StudentMarkPassedDisciplines_StudentId_DisciplineId_Semester_Mark",
|
||||
table: "StudentMarkPassedDisciplines",
|
||||
columns: new[] { "StudentId", "DisciplineId", "Semester", "Mark" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
28
DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs
Normal file
28
DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace CoreDatabase.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Базовый набор для сущности
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class BaseEntity : IdEntity
|
||||
{
|
||||
[DataMember]
|
||||
public DateTime DateCreate { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public DateTime? DateDelete { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public BaseEntity() : base()
|
||||
{
|
||||
DateCreate = DateTime.Now;
|
||||
DateDelete = null;
|
||||
IsDeleted = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class AcademicPlan : BaseEntity, IEntitySecurityExtenstion<AcademicPlan>, IAcademicPlanModel
|
||||
{
|
||||
[DataMember]
|
||||
public Guid? EducationDirectionId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public int YearStart { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public DateTime LastUpdateDate { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual EducationDirection EducationDirection { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("AcademicPlanId")]
|
||||
public virtual List<AcademicPlanRecord> AcademicPlanRecords { get; set; }
|
||||
|
||||
[ForeignKey("AcademicPlanId")]
|
||||
public virtual List<StudentGroup> StudentGroups { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public AcademicPlan SecurityCheck(AcademicPlan entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{EducationDirection?.ShortName}({EducationDirection?.Profile}): {YearStart}";
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
using CoreModels.Enums.Department;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class AcademicPlanRecord : BaseEntity, IEntitySecurityExtenstion<AcademicPlanRecord>, IAcademicPlanRecordModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid AcademicPlanId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid DisciplineId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public bool InDepartment { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Semester Semester { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public int Zet { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Guid? AcademicPlanRecordParentId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsParent { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsFacultative { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual AcademicPlan AcademicPlan { get; set; }
|
||||
|
||||
public virtual Discipline Discipline { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("AcademicPlanRecordId")]
|
||||
public virtual List<AcademicPlanRecordTimeNormHour> AcademicPlanRecordTimeNormHours { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public AcademicPlanRecord SecurityCheck(AcademicPlanRecord entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{Discipline} - {Semester + 1} семестр";
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class AcademicPlanRecordTimeNormHour : BaseEntity, IEntitySecurityExtenstion<AcademicPlanRecordTimeNormHour>, IAcademicPlanRecordTimeNormHourModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid AcademicPlanRecordId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid TimeNormId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public decimal PlanHours { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual AcademicPlanRecord AcademicPlanRecord { get; set; }
|
||||
|
||||
public virtual TimeNorm TimeNorm { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public AcademicPlanRecordTimeNormHour SecurityCheck(AcademicPlanRecordTimeNormHour entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{AcademicPlanRecord.Discipline}({(AcademicPlanRecord.Semester + 1)}) - {TimeNorm}";
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
/// <summary>
|
||||
/// Класс, описывающий базовую кафедру
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class BasicDepartment : BaseEntity, IEntitySecurityExtenstion<BasicDepartment>, IBasicDepartmentModel
|
||||
{
|
||||
public Guid? LecturerId { get; set; }
|
||||
|
||||
public string BasicDepartmentName { get; set; }
|
||||
|
||||
public string BasicDepartmentDescription { get; set; }
|
||||
|
||||
public string EnterprisesName { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual Lecturer Lecturer { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("BasicDepartmentId")]
|
||||
public virtual List<Discipline> Disciplines { get; set; }
|
||||
|
||||
[ForeignKey("BasicDepartmentId")]
|
||||
public virtual List<Student> Students { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public BasicDepartment SecurityCheck(BasicDepartment entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => BasicDepartmentName;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
using CoreModels.Enums.Department;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class Classroom : BaseEntity, IEntitySecurityExtenstion<Classroom>, IClassroomModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string Number { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Title { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid EmployeeId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public ClassroomType ClassroomType { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public decimal Square { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public int Capacity { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string SecurityCode { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool HaveProjector { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public byte[] Photo { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual Employee Employee { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public Classroom SecurityCheck(Classroom entity, bool allowFullData)
|
||||
{
|
||||
if (!allowFullData)
|
||||
{
|
||||
entity.SecurityCode = "скрыто";
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public override string ToString() => Number;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
/// <summary>
|
||||
/// Класс, описывающий дисципилну кафедры
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class Discipline : BaseEntity, IEntitySecurityExtenstion<Discipline>, IDisciplineModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid DisciplineBlockId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Guid? BasicDepartmentId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string DisciplineName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string DisciplineShortName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
|
||||
public string DisciplineBlueAsteriskName { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual DisciplineBlock DisciplineBlock { get; set; }
|
||||
|
||||
public virtual BasicDepartment BasicDepartment { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("DisciplineId")]
|
||||
public virtual List<AcademicPlanRecord> AcademicPlanRecords { get; set; }
|
||||
|
||||
[ForeignKey("DisciplineId")]
|
||||
public virtual List<StudentMarkPassedDiscipline> StudentMarkPassedDisciplines { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public Discipline SecurityCheck(Discipline entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => DisciplineName;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class DisciplineBlock : BaseEntity, IEntitySecurityExtenstion<DisciplineBlock>, IDisciplineBlockModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string Title { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool DisciplineBlockUseForGrouping { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public int DisciplineBlockOrder { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string DisciplineBlockBlueAsteriskName { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("DisciplineBlockId")]
|
||||
public virtual List<Discipline> Disciplines { get; set; }
|
||||
|
||||
[ForeignKey("DisciplineBlockId")]
|
||||
public virtual List<TimeNorm> TimeNorms { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public DisciplineBlock SecurityCheck(DisciplineBlock entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => Title;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
using CoreModels.Enums.Department;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
/// <summary>
|
||||
/// Класс, описывающий направление обучения кафедры
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class EducationDirection : BaseEntity, IEntitySecurityExtenstion<EducationDirection>, IEducationDirectionModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string Cipher { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string ShortName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Profile { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public EducationDirectionQualification Qualification { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public Guid LecturerId { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual Lecturer Lecturer { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("EducationDirectionId")]
|
||||
public virtual List<AcademicPlan> AcademicPlans { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public EducationDirection SecurityCheck(EducationDirection entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{Cipher} {ShortName}({Profile})";
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
using CoreDatabase.Models.Security;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentExtension;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class Employee : BaseEntity, IEntitySecurityExtenstion<Employee>, IEmployeeModel
|
||||
{
|
||||
[DataMember]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string LastName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Patronymic { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public DateTime DateBirth { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Address { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Email { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string MobileNumber { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string HomeNumber { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public byte[] Photo { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string GroupElectricalSafety { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual User User { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("EmployeeId")]
|
||||
public virtual List<EmployeePost> EmployeePosts { get; set; }
|
||||
|
||||
[ForeignKey("EmployeeId")]
|
||||
public virtual List<Classroom> Classrooms { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public Employee SecurityCheck(Employee entity, bool allowFullData)
|
||||
{
|
||||
if (!allowFullData)
|
||||
{
|
||||
entity.DateBirth = DateTime.Now;
|
||||
entity.Address = "скрыто";
|
||||
entity.Email = "скрыто";
|
||||
entity.MobileNumber = "скрыто";
|
||||
entity.HomeNumber = "скрыто";
|
||||
entity.Photo = null;
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
$"{LastName}{(FirstName.IsNotEmpty() ? $" {FirstName[0]}." : string.Empty)}{(Patronymic.IsNotEmpty() ? $"{Patronymic[0]}." : string.Empty)}";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class EmployeePost : BaseEntity, IEntitySecurityExtenstion<EmployeePost>, IEmployeePostModel
|
||||
{
|
||||
[DataMember]
|
||||
public Guid EmployeeId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Guid PostId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public decimal Rate { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsInternalCombination { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsExternalCombination { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual Post Post { get; set; }
|
||||
|
||||
public virtual Employee Employee { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public EmployeePost SecurityCheck(EmployeePost entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{Post}-{Employee}";
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
using CoreDatabase.Models.Security;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentExtension;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class Lecturer : BaseEntity, IEntitySecurityExtenstion<Lecturer>, ILecturerModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Guid? LecturerAcademicRankId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public Guid? LecturerAcademicDegreeId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string LastName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Patronymic { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Abbreviation { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public DateTime DateBirth { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string Address { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string Email { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string MobileNumber { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string HomeNumber { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public byte[] Photo { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool OnlyForPrivate { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string GroupElectricalSafety { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual User User { get; set; }
|
||||
|
||||
public virtual LecturerAcademicRank LecturerAcademicRank { get; set; }
|
||||
|
||||
public virtual LecturerAcademicDegree LecturerAcademicDegree { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("LecturerId")]
|
||||
public virtual List<LecturerPost> LecturerPosts { get; set; }
|
||||
|
||||
[ForeignKey("LecturerId")]
|
||||
public virtual List<EducationDirection> EducationDirections { get; set; }
|
||||
|
||||
[ForeignKey("LecturerId")]
|
||||
public virtual List<StudentGroup> StudentGroups { get; set; }
|
||||
|
||||
[ForeignKey("LecturerId")]
|
||||
public virtual List<BasicDepartment> BasicDepartments { get; set; }
|
||||
|
||||
[ForeignKey("LecturerId")]
|
||||
public virtual List<StudentMarkPassedDiscipline> StudentMarkPassedDisciplines { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public Lecturer SecurityCheck(Lecturer entity, bool allowFullData)
|
||||
{
|
||||
if (!allowFullData)
|
||||
{
|
||||
entity.DateBirth = DateTime.Now;
|
||||
entity.Address = "скрыто";
|
||||
entity.Email = "скрыто";
|
||||
entity.MobileNumber = "скрыто";
|
||||
entity.HomeNumber = "скрыто";
|
||||
entity.Photo = null;
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public override string ToString() =>
|
||||
$"{LastName}{(FirstName.IsNotEmpty() ? $" {FirstName[0]}." : string.Empty)}{(Patronymic.IsNotEmpty() ? $"{Patronymic[0]}." : string.Empty)}";
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class LecturerAcademicDegree : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicDegree>, ILecturerAcademicDegreeModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string LecturerAcademicDegreeName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Description { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public int Order { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("LecturerAcademicDegreeId")]
|
||||
public virtual List<Lecturer> Lecturers { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public LecturerAcademicDegree SecurityCheck(LecturerAcademicDegree entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => LecturerAcademicDegreeName;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class LecturerAcademicRank : BaseEntity, IEntitySecurityExtenstion<LecturerAcademicRank>, ILecturerAcademicRankModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required]
|
||||
public string LecturerAcademicRankName { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public int Order { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("LecturerAcademicRankId")]
|
||||
public virtual List<Lecturer> Lecturers { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public LecturerAcademicRank SecurityCheck(LecturerAcademicRank entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => LecturerAcademicRankName;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class LecturerPost : BaseEntity, IEntitySecurityExtenstion<LecturerPost>, ILecturerPostModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required]
|
||||
public Guid LecturerId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public Guid PostId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required]
|
||||
public decimal Rate { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsInternalCombination { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool IsExternalCombination { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public virtual Post Post { get; set; }
|
||||
|
||||
public virtual Lecturer Lecturer { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public LecturerPost SecurityCheck(LecturerPost entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"{Lecturer}-{Post}";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
using CoreModels.Enums.Department;
|
||||
using CoreModels.ModelsDepartment;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using ToolsModule.ManagmentSecurity;
|
||||
|
||||
namespace CoreDatabase.Models.Department
|
||||
{
|
||||
[DataContract]
|
||||
public class Order : BaseEntity, IEntitySecurityExtenstion<Order>, IOrderModel
|
||||
{
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public string OrderNumber { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public DateTime OrderDate { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Required(ErrorMessage = "required")]
|
||||
public OrderType OrderType { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
[ForeignKey("OrderId")]
|
||||
public virtual List<OrderStudentRecord> OrderStudentRecords { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public Order SecurityCheck(Order entity, bool allowFullData) => entity;
|
||||
|
||||
public override string ToString() => $"№{OrderNumber} от {OrderDate.ToShortDateString()}";
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user