From 2ccbccd6d4fea8b98d5a2397cea4fb9d391eda3d Mon Sep 17 00:00:00 2001 From: kotcheshir73 Date: Fri, 18 Mar 2022 22:55:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=20CoreDatabase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractGenerticEntityService.cs | 268 +++ .../Common/CoreDatabase/CoreDatabase.csproj | 17 + .../Common/CoreDatabase/DatabaseContext.cs | 127 ++ .../Common/CoreDatabase/DatabaseManager.cs | 13 + ...210326072923_AddSecurityModels.Designer.cs | 211 +++ .../20210326072923_AddSecurityModels.cs | 146 ++ ...327194001_ChangeSecurityFields.Designer.cs | 217 +++ .../20210327194001_ChangeSecurityFields.cs | 66 + ...escriptionInEnviromentSettings.Designer.cs | 220 +++ ...5041_AddDescriptionInEnviromentSettings.cs | 23 + ...401105731_UpdateSecurityModels.Designer.cs | 216 +++ .../20210401105731_UpdateSecurityModels.cs | 90 + .../20210403054350_AddEmployee.Designer.cs | 379 +++++ .../Migrations/20210403054350_AddEmployee.cs | 177 ++ .../20210403090025_AddClassrooms.Designer.cs | 445 +++++ .../20210403090025_AddClassrooms.cs | 78 + .../20210403143118_AddDisciplines.Designer.cs | 535 ++++++ .../20210403143118_AddDisciplines.cs | 154 ++ .../20210403180333_AddLecturers.Designer.cs | 829 ++++++++++ .../Migrations/20210403180333_AddLecturers.cs | 239 +++ ...turerAcademicDegreeDiscription.Designer.cs | 832 ++++++++++ ...31_AddLecturerAcademicDegreeDiscription.cs | 23 + ...065039_AddDiciplineDescription.Designer.cs | 835 ++++++++++ .../20210404065039_AddDiciplineDescription.cs | 23 + .../20210404070556_AddLecturer.Designer.cs | 838 ++++++++++ .../Migrations/20210404070556_AddLecturer.cs | 23 + ...0734_AddLecturerOnlyForPrivate.Designer.cs | 841 ++++++++++ ...0210404070734_AddLecturerOnlyForPrivate.cs | 24 + ...0210404170518_RemLecturerField.Designer.cs | 845 ++++++++++ .../20210404170518_RemLecturerField.cs | 23 + ...28_AddEnviromentSettingsFields.Designer.cs | 854 ++++++++++ ...10405060128_AddEnviromentSettingsFields.cs | 46 + ...20210405080239_RemLecturerPost.Designer.cs | 810 +++++++++ .../20210405080239_RemLecturerPost.cs | 419 +++++ ...10405082110_AddFieldToLecturer.Designer.cs | 813 +++++++++ .../20210405082110_AddFieldToLecturer.cs | 23 + ...10405082213_RemFieldToLecturer.Designer.cs | 807 +++++++++ .../20210405082213_RemFieldToLecturer.cs | 36 + ...05091403_AddEducationDirection.Designer.cs | 870 ++++++++++ .../20210405091403_AddEducationDirection.cs | 95 ++ ...913_UPdFieldEducationDirection.Designer.cs | 869 ++++++++++ ...210405095913_UPdFieldEducationDirection.cs | 29 + ...0210405171658_AddAcademicPlans.Designer.cs | 1131 +++++++++++++ .../20210405171658_AddAcademicPlans.cs | 183 +++ ...210406063922_UpdUniqueTimeNorm.Designer.cs | 1131 +++++++++++++ .../20210406063922_UpdUniqueTimeNorm.cs | 72 + ...64319_ChangeTypeInacademicPlan.Designer.cs | 1131 +++++++++++++ ...20210406064319_ChangeTypeInacademicPlan.cs | 101 ++ ...0210408152438_ChangeAcademPlan.Designer.cs | 1130 +++++++++++++ .../20210408152438_ChangeAcademPlan.cs | 100 ++ ...0210412051258_AddStudentGroups.Designer.cs | 1187 ++++++++++++++ .../20210412051258_AddStudentGroups.cs | 81 + .../20210412101248_AddStudents.Designer.cs | 1276 +++++++++++++++ .../Migrations/20210412101248_AddStudents.cs | 70 + .../20210413070716_AddOrders.Designer.cs | 1401 ++++++++++++++++ .../Migrations/20210413070716_AddOrders.cs | 108 ++ ...17172126_AddOrderSyncHistories.Designer.cs | 1449 ++++++++++++++++ .../20210417172126_AddOrderSyncHistories.cs | 102 ++ ...0427134459_ChangeStudentGroups.Designer.cs | 1450 ++++++++++++++++ .../20210427134459_ChangeStudentGroups.cs | 67 + .../20210428150932_UpdateStudnet.Designer.cs | 1454 +++++++++++++++++ .../20210428150932_UpdateStudnet.cs | 24 + .../20210430050931_UpdateStudnet2.Designer.cs | 1453 ++++++++++++++++ .../20210430050931_UpdateStudnet2.cs | 31 + .../20210430051530_UpdateStudnet3.Designer.cs | 1450 ++++++++++++++++ .../20210430051530_UpdateStudnet3.cs | 56 + .../DatabaseContextModelSnapshot.cs | 1448 ++++++++++++++++ .../Common/CoreDatabase/Models/BaseEntity.cs | 28 + .../Models/Department/AcademicPlan.cs | 40 + .../Models/Department/AcademicPlanRecord.cs | 61 + .../AcademicPlanRecordTimeNormHour.cs | 38 + .../Models/Department/Classroom.cs | 68 + .../Models/Department/Discipline.cs | 48 + .../Models/Department/DisciplineBlock.cs | 42 + .../Models/Department/EducationDirection.cs | 60 + .../Models/Department/Employee.cs | 83 + .../Models/Department/EmployeePost.cs | 40 + .../Models/Department/Lecturer.cs | 110 ++ .../Department/LecturerAcademicDegree.cs | 36 + .../Models/Department/LecturerAcademicRank.cs | 33 + .../Models/Department/LecturerPost.cs | 44 + .../CoreDatabase/Models/Department/Order.cs | 40 + .../Models/Department/OrderStudentRecord.cs | 61 + .../Models/Department/OrderSyncHistory.cs | 31 + .../Department/OrderSyncHistoryRecord.cs | 40 + .../CoreDatabase/Models/Department/Post.cs | 37 + .../CoreDatabase/Models/Department/Student.cs | 86 + .../Models/Department/StudentGroup.cs | 59 + .../Models/Department/TimeNorm.cs | 71 + .../Common/CoreDatabase/Models/IdEntity.cs | 24 + .../CoreDatabase/Models/Security/Access.cs | 44 + .../Models/Security/EnviromentSetting.cs | 39 + .../CoreDatabase/Models/Security/Role.cs | 37 + .../CoreDatabase/Models/Security/User.cs | 74 + .../CoreDatabase/Models/Security/UserRole.cs | 31 + .../Scripts/DepartmentMigrationScript.cs | 129 ++ .../Scripts/SecureMigrationScript.cs | 57 + .../Common/CoreDatabase/SecurityManager.cs | 237 +++ .../AbstractGenerticEntityService.cs | 4 +- .../Common/DatabaseCore/DatabaseContext.cs | 6 +- .../Common/DatabaseCore/DatabaseManager.cs | 2 +- ...210326072923_AddSecurityModels.Designer.cs | 28 +- .../20210326072923_AddSecurityModels.cs | 2 +- ...327194001_ChangeSecurityFields.Designer.cs | 28 +- .../20210327194001_ChangeSecurityFields.cs | 2 +- ...escriptionInEnviromentSettings.Designer.cs | 28 +- ...5041_AddDescriptionInEnviromentSettings.cs | 2 +- ...401105731_UpdateSecurityModels.Designer.cs | 28 +- .../20210401105731_UpdateSecurityModels.cs | 2 +- .../20210403054350_AddEmployee.Designer.cs | 44 +- .../Migrations/20210403054350_AddEmployee.cs | 2 +- .../20210403090025_AddClassrooms.Designer.cs | 50 +- .../20210403090025_AddClassrooms.cs | 2 +- .../20210403143118_AddDisciplines.Designer.cs | 60 +- .../20210403143118_AddDisciplines.cs | 2 +- .../20210403180333_AddLecturers.Designer.cs | 96 +- .../Migrations/20210403180333_AddLecturers.cs | 2 +- ...turerAcademicDegreeDiscription.Designer.cs | 96 +- ...31_AddLecturerAcademicDegreeDiscription.cs | 2 +- ...065039_AddDiciplineDescription.Designer.cs | 96 +- .../20210404065039_AddDiciplineDescription.cs | 2 +- .../20210404070556_AddLecturer.Designer.cs | 96 +- .../Migrations/20210404070556_AddLecturer.cs | 2 +- ...0734_AddLecturerOnlyForPrivate.Designer.cs | 96 +- ...0210404070734_AddLecturerOnlyForPrivate.cs | 2 +- ...0210404170518_RemLecturerField.Designer.cs | 98 +- .../20210404170518_RemLecturerField.cs | 2 +- ...28_AddEnviromentSettingsFields.Designer.cs | 98 +- ...10405060128_AddEnviromentSettingsFields.cs | 2 +- ...20210405080239_RemLecturerPost.Designer.cs | 92 +- .../20210405080239_RemLecturerPost.cs | 2 +- ...10405082110_AddFieldToLecturer.Designer.cs | 92 +- .../20210405082110_AddFieldToLecturer.cs | 2 +- ...10405082213_RemFieldToLecturer.Designer.cs | 92 +- .../20210405082213_RemFieldToLecturer.cs | 2 +- ...05091403_AddEducationDirection.Designer.cs | 98 +- .../20210405091403_AddEducationDirection.cs | 2 +- ...913_UPdFieldEducationDirection.Designer.cs | 98 +- ...210405095913_UPdFieldEducationDirection.cs | 2 +- ...0210405171658_AddAcademicPlans.Designer.cs | 136 +- .../20210405171658_AddAcademicPlans.cs | 2 +- ...210406063922_UpdUniqueTimeNorm.Designer.cs | 136 +- .../20210406063922_UpdUniqueTimeNorm.cs | 2 +- ...64319_ChangeTypeInacademicPlan.Designer.cs | 136 +- ...20210406064319_ChangeTypeInacademicPlan.cs | 2 +- ...0210408152438_ChangeAcademPlan.Designer.cs | 136 +- .../20210408152438_ChangeAcademPlan.cs | 2 +- ...0210412051258_AddStudentGroups.Designer.cs | 144 +- .../20210412051258_AddStudentGroups.cs | 2 +- .../20210412101248_AddStudents.Designer.cs | 154 +- .../Migrations/20210412101248_AddStudents.cs | 2 +- .../20210413070716_AddOrders.Designer.cs | 172 +- .../Migrations/20210413070716_AddOrders.cs | 2 +- ...17172126_AddOrderSyncHistories.Designer.cs | 182 +-- .../20210417172126_AddOrderSyncHistories.cs | 2 +- ...0427134459_ChangeStudentGroups.Designer.cs | 182 +-- .../20210427134459_ChangeStudentGroups.cs | 2 +- .../20210428150932_UpdateStudnet.Designer.cs | 182 +-- .../20210428150932_UpdateStudnet.cs | 2 +- .../20210430050931_UpdateStudnet2.Designer.cs | 182 +-- .../20210430050931_UpdateStudnet2.cs | 2 +- .../20210430051530_UpdateStudnet3.Designer.cs | 182 +-- .../20210430051530_UpdateStudnet3.cs | 2 +- .../DatabaseContextModelSnapshot.cs | 182 +-- .../Common/DatabaseCore/Models/BaseEntity.cs | 2 +- .../Models/Department/AcademicPlan.cs | 2 +- .../Models/Department/AcademicPlanRecord.cs | 2 +- .../AcademicPlanRecordTimeNormHour.cs | 2 +- .../Models/Department/Classroom.cs | 2 +- .../Models/Department/Discipline.cs | 2 +- .../Models/Department/DisciplineBlock.cs | 2 +- .../Models/Department/EducationDirection.cs | 2 +- .../Models/Department/Employee.cs | 4 +- .../Models/Department/EmployeePost.cs | 2 +- .../Models/Department/Lecturer.cs | 4 +- .../Department/LecturerAcademicDegree.cs | 2 +- .../Models/Department/LecturerAcademicRank.cs | 2 +- .../Models/Department/LecturerPost.cs | 2 +- .../DatabaseCore/Models/Department/Order.cs | 2 +- .../Models/Department/OrderStudentRecord.cs | 2 +- .../Models/Department/OrderSyncHistory.cs | 2 +- .../Department/OrderSyncHistoryRecord.cs | 2 +- .../DatabaseCore/Models/Department/Post.cs | 2 +- .../DatabaseCore/Models/Department/Student.cs | 4 +- .../Models/Department/StudentGroup.cs | 2 +- .../Models/Department/TimeNorm.cs | 2 +- .../Common/DatabaseCore/Models/IdEntity.cs | 2 +- .../DatabaseCore/Models/Security/Access.cs | 2 +- .../Models/Security/EnviromentSetting.cs | 2 +- .../DatabaseCore/Models/Security/Role.cs | 2 +- .../DatabaseCore/Models/Security/User.cs | 4 +- .../DatabaseCore/Models/Security/UserRole.cs | 2 +- .../Scripts/DepartmentMigrationScript.cs | 2 +- .../Scripts/SecureMigrationScript.cs | 2 +- .../Common/DatabaseCore/SecurityManager.cs | 4 +- .../DepartmentDatabaseImplementation.csproj | 4 +- .../AcademicPlanRecordService.cs | 4 +- .../AcademicPlanRecordTimeNormHourService.cs | 4 +- .../Implementations/AcademicPlanService.cs | 4 +- .../Implementations/ClassroomService.cs | 4 +- .../Implementations/DisciplineBlockService.cs | 4 +- .../Implementations/DisciplineService.cs | 4 +- .../EducationDirectionService.cs | 4 +- .../Implementations/EmployeePostService.cs | 4 +- .../Implementations/EmployeeService.cs | 4 +- .../LecturerAcademicDegreeService.cs | 4 +- .../LecturerAcademicRankService.cs | 4 +- .../Implementations/LecturerPostService.cs | 4 +- .../Implementations/LecturerService.cs | 4 +- .../Implementations/OrderService.cs | 4 +- .../OrderStudentRecordService.cs | 4 +- .../OrderSyncHistoryRecordService.cs | 4 +- .../OrderSyncHistoryService.cs | 4 +- .../Implementations/PostService.cs | 4 +- .../Implementations/StudentGroupService.cs | 4 +- .../Implementations/StudentService.cs | 4 +- .../Implementations/TimeNormService.cs | 4 +- .../Models/ParsPlxModel.cs | 2 +- DepartmentPortal/DepartmentPortal.sln | 14 +- .../DepartmentPortalDesctop.csproj | 2 +- .../DepartmentPortalDesctop/Program.cs | 2 +- .../Implementations/AccessService.cs | 4 +- .../BackupJsonContractService.cs | 2 +- .../EnviromentSettingService.cs | 4 +- .../Implementations/RoleService.cs | 4 +- .../Implementations/UserRoleService.cs | 4 +- .../Implementations/UserService.cs | 6 +- .../SecurityDatabaseImplementation.csproj | 4 +- 228 files changed, 36243 insertions(+), 1901 deletions(-) create mode 100644 DepartmentPortal/Common/CoreDatabase/AbstractGenerticEntityService.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj create mode 100644 DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Migrations/DatabaseContextModelSnapshot.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlan.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecord.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecordTimeNormHour.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Classroom.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Discipline.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/DisciplineBlock.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/EducationDirection.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Employee.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/EmployeePost.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Lecturer.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicDegree.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicRank.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerPost.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Order.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/OrderStudentRecord.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistory.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistoryRecord.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Post.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/Student.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/StudentGroup.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Department/TimeNorm.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/IdEntity.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Security/Access.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Security/EnviromentSetting.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Security/Role.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Security/User.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Models/Security/UserRole.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Scripts/DepartmentMigrationScript.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/Scripts/SecureMigrationScript.cs create mode 100644 DepartmentPortal/Common/CoreDatabase/SecurityManager.cs diff --git a/DepartmentPortal/Common/CoreDatabase/AbstractGenerticEntityService.cs b/DepartmentPortal/Common/CoreDatabase/AbstractGenerticEntityService.cs new file mode 100644 index 0000000..9611160 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/AbstractGenerticEntityService.cs @@ -0,0 +1,268 @@ +using CoreDatabase.Models; +using Microsoft.EntityFrameworkCore; +using ToolsModule.BindingModels; +using ToolsModule.BusinessLogics; +using ToolsModule.Enums; +using ToolsModule.Interfaces; +using ToolsModule.Models; +using ToolsModule.ViewModels; +using System; +using System.Linq; + +namespace CoreDatabase +{ + public abstract class AbstractGenerticEntityService : IGenerticEntityService + where G : GetBindingModel + where S : SetBindingModel + where T : BaseEntity + where L : ListViewModel, 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, context); + if (exsistEntity == null) + { + var entity = Mapper.MapToClass(model, true); + context.Set().Add(entity); + context.SaveChanges(); + return OperationResultModel.Success(Mapper.MapToClass(entity, true)); + } + else + { + if (exsistEntity.IsDeleted) + { + exsistEntity = Mapper.MapToClass(model, exsistEntity, true); + exsistEntity.IsDeleted = false; + context.SaveChanges(); + return OperationResultModel.Success(Mapper.MapToClass(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().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().AsQueryable()).FirstOrDefault(x => x.Id == model.Id.Value) + : GetSingleRecord(context.Set().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(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().AsQueryable()).FirstOrDefault(x => x.Id == model.Id.Value) + : GetSingleRecord(context.Set().AsQueryable(), model); + if (entity == null) + { + return OperationResultModel.Error("Error:", "Элемент не найден", ResultServiceStatusCode.NotFound); + } + if (entity.IsDeleted) + { + return OperationResultModel.Error("Error:", "Элемент удален", ResultServiceStatusCode.WasDelete); + } + return OperationResultModel.Success(Mapper.MapToClass(entity, model.HaveRight)); + } + + var query = context.Set().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(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, context); + if (exsistEntity != null) + { + return OperationResultModel.Error("Error:", "Существует запись с такими значениями", ResultServiceStatusCode.ExsistItem); + } + + var entity = context.Set().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(entity, true)); + } + + /// + /// Поиск записи с уникальными значениями + /// + /// + /// + protected abstract T GetUniqueEntity(S model, DbContext context); + + /// + /// Возможные дополнительные проверки при добавлении + /// + /// + /// + /// + protected abstract OperationResultModel AdditionalCheckingWhenAdding(DbContext context, S model); + + /// + /// Возможные дополнительные проверки при удалении + /// + /// + /// + /// + protected abstract OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, T entity, G model); + + /// + /// Добавление дополнительных фильтров + /// + /// + /// + /// + protected abstract IQueryable AdditionalCheckingWhenReadingList(IQueryable query, G model); + + /// + /// Возможные дополнительные проверки модели при изменении + /// + /// + protected abstract OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, S model); + + /// + /// Дополнительные удаления зависимых сущностей + /// + /// + protected abstract void AdditionalDeleting(DbContext context, T entity, G model); + + /// + /// Установка сортировок + /// + /// + /// + protected abstract IQueryable OrderingWhenReading(IQueryable query); + + /// + /// Добавление Include + /// + /// + /// + protected abstract IQueryable IncludingWhenReading(IQueryable query); + + /// + /// Дополнительыне проверки, если требуется получать единичную запись но не по id + /// + /// + /// + protected virtual bool AdditionalCheckForSingleGet(G model) => false; + + /// + /// Получение единичной записи но не по id + /// + /// + /// + /// + protected virtual T GetSingleRecord(IQueryable list, G model) => null; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj b/DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj new file mode 100644 index 0000000..eacb4a7 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/CoreDatabase.csproj @@ -0,0 +1,17 @@ + + + + net5.0 + + + + + + + + + + + + + diff --git a/DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs b/DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs new file mode 100644 index 0000000..465d196 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/DatabaseContext.cs @@ -0,0 +1,127 @@ +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.ServiceProvider.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().HasIndex(s => s.Key).IsUnique(); + + modelBuilder.Entity().HasIndex(s => s.RoleName).IsUnique(); + + modelBuilder.Entity().HasIndex(s => s.UserName); + + modelBuilder.Entity().HasIndex(s => s.PostName).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.FirstName, d.LastName, d.Patronymic }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.Number }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.Title }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.DisciplineName }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.LecturerAcademicDegreeName }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.LecturerAcademicRankName }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.FirstName, d.LastName, d.Patronymic }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.Title, d.Profile }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.TimeNormName, d.TimeNormShortName }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.EducationDirectionId, d.YearEntrance }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanId, d.DisciplineId, d.Semester }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanRecordId, d.TimeNormId }).IsUnique(); + + // ругается на циклическое каскадное удаление, так что по нормам времени убираем ее + modelBuilder.Entity() + .HasOne(x => x.TimeNorm) + .WithMany(x => x.AcademicPlanRecordTimeNormHours) + .OnDelete(DeleteBehavior.NoAction); + + modelBuilder.Entity().HasIndex(d => new { d.EducationDirectionId, d.AcademicCourse, d.GroupNumber }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.NumberOfBook }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.OrderNumber }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.StudentId, d.OrderId }).IsUnique(); + + modelBuilder.Entity() + .HasOne(x => x.StudentGroupFrom) + .WithMany(p => p.OrderStudentRecordFroms) + .HasForeignKey(pt => pt.StudentGroupFromId) + .OnDelete(DeleteBehavior.SetNull); + + modelBuilder.Entity() + .HasOne(x => x.StudentGroupTo) + .WithMany(p => p.OrderStudentRecordTos) + .HasForeignKey(pt => pt.StudentGroupToId) + .OnDelete(DeleteBehavior.NoAction); + + // ругается на циклическое каскадное удаление, так что по нормам времени убираем ее + modelBuilder.Entity() + .HasOne(x => x.Student) + .WithMany(x => x.OrderStudentRecords) + .OnDelete(DeleteBehavior.NoAction); + + } + + #region Security + public virtual DbSet Accesses { set; get; } + public virtual DbSet EnviromentSettings { set; get; } + public virtual DbSet Roles { set; get; } + public virtual DbSet Users { set; get; } + public virtual DbSet UserRoles { set; get; } + #endregion + + #region Department + public virtual DbSet Posts { set; get; } + public virtual DbSet Employees { set; get; } + public virtual DbSet EmployeePosts { set; get; } + public virtual DbSet Classrooms { set; get; } + public virtual DbSet DisciplineBlocks { set; get; } + public virtual DbSet Disciplines { set; get; } + public virtual DbSet LecturerAcademicDegrees { set; get; } + public virtual DbSet LecturerAcademicRanks { set; get; } + public virtual DbSet LecturerPosts { set; get; } + public virtual DbSet Lecturers { set; get; } + public virtual DbSet EducationDirections { set; get; } + public virtual DbSet TimeNorms { set; get; } + public virtual DbSet AcademicPlans { set; get; } + public virtual DbSet AcademicPlanRecords { set; get; } + public virtual DbSet AcademicPlanRecordTimeNormHours { set; get; } + public virtual DbSet StudentGroups { set; get; } + public virtual DbSet Students { set; get; } + public virtual DbSet Orders { set; get; } + public virtual DbSet OrderStudentRecords { set; get; } + public virtual DbSet OrderSyncHistories { set; get; } + public virtual DbSet OrderSyncHistoryRecords { set; get; } + #endregion + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs b/DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs new file mode 100644 index 0000000..f3758b5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/DatabaseManager.cs @@ -0,0 +1,13 @@ +namespace CoreDatabase +{ + /// + /// Работа с БД + /// + public static class DatabaseManager + { + /// + /// Получение объекта от класса DbContext + /// + public static DatabaseContext GetContext => new(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs new file mode 100644 index 0000000..6b141db --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.Designer.cs @@ -0,0 +1,211 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(max)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("DateLocked") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.cs new file mode 100644 index 0000000..f2b5094 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210326072923_AddSecurityModels.cs @@ -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(type: "uniqueidentifier", nullable: false), + Key = table.Column(type: "nvarchar(max)", nullable: true), + Value = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EnviromentSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Roles", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + RoleName = table.Column(type: "nvarchar(max)", nullable: true), + RolePriority = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Roles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + UserName = table.Column(type: "nvarchar(max)", nullable: true), + PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), + StudentId = table.Column(type: "uniqueidentifier", nullable: true), + LecturerId = table.Column(type: "uniqueidentifier", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + Avatar = table.Column(type: "varbinary(max)", nullable: true), + DateLastVisit = table.Column(type: "datetime2", nullable: true), + IsBanned = table.Column(type: "bit", nullable: false), + DateBanned = table.Column(type: "datetime2", nullable: true), + CountAttempt = table.Column(type: "int", nullable: false), + DateLocked = table.Column(type: "datetime2", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Accesses", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + RoleId = table.Column(type: "uniqueidentifier", nullable: false), + Operation = table.Column(type: "int", nullable: false), + AccessType = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false), + RoleId = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs new file mode 100644 index 0000000..b4af9e9 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.Designer.cs @@ -0,0 +1,217 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(max)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.cs new file mode 100644 index 0000000..6e75066 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210327194001_ChangeSecurityFields.cs @@ -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( + name: "DateCreate", + table: "UserRoles", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "DateDelete", + table: "UserRoles", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + 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( + name: "DateLocked", + table: "Users", + type: "datetime2", + nullable: true); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs new file mode 100644 index 0000000..3dca87d --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs @@ -0,0 +1,220 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(max)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs new file mode 100644 index 0000000..e4bac25 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddDescriptionInEnviromentSettings : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Description", + table: "EnviromentSettings", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Description", + table: "EnviromentSettings"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs new file mode 100644 index 0000000..fb889d8 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.Designer.cs @@ -0,0 +1,216 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(max)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.cs new file mode 100644 index 0000000..387ff49 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210401105731_UpdateSecurityModels.cs @@ -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( + name: "Value", + table: "EnviromentSettings", + type: "nvarchar(max)", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + 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( + name: "EmployeeId", + table: "Users", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "LecturerId", + table: "Users", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "StudentId", + table: "Users", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "EnviromentSettings", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + name: "Key", + table: "EnviromentSettings", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs new file mode 100644 index 0000000..3671c84 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.Designer.cs @@ -0,0 +1,379 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique() + .HasFilter("[RoleName] IS NOT NULL"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName") + .IsUnique() + .HasFilter("[UserName] IS NOT NULL"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.cs new file mode 100644 index 0000000..5f6ff6c --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403054350_AddEmployee.cs @@ -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( + name: "UserName", + table: "Users", + type: "nvarchar(450)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + 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(type: "uniqueidentifier", nullable: false), + EmployeePostName = table.Column(type: "nvarchar(450)", nullable: true), + Order = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EmployeePosts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Employees", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: false), + FirstName = table.Column(type: "nvarchar(450)", nullable: true), + LastName = table.Column(type: "nvarchar(450)", nullable: true), + Patronymic = table.Column(type: "nvarchar(450)", nullable: true), + DateBirth = table.Column(type: "datetime2", nullable: false), + Address = table.Column(type: "nvarchar(max)", nullable: true), + Email = table.Column(type: "nvarchar(max)", nullable: true), + MobileNumber = table.Column(type: "nvarchar(max)", nullable: true), + HomeNumber = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Photo = table.Column(type: "varbinary(max)", nullable: true), + GroupElectricalSafety = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Employees", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "EmployeeEmployeePosts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeePostId = table.Column(type: "uniqueidentifier", nullable: false), + Rate = table.Column(type: "decimal(18,2)", nullable: false), + IsInternalCombination = table.Column(type: "bit", nullable: false), + IsExternalCombination = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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( + name: "UserName", + table: "Users", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RoleName", + table: "Roles", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs new file mode 100644 index 0000000..648c7f3 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.Designer.cs @@ -0,0 +1,445 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique() + .HasFilter("[RoleName] IS NOT NULL"); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.cs new file mode 100644 index 0000000..aa14709 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403090025_AddClassrooms.cs @@ -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(type: "uniqueidentifier", nullable: false), + Number = table.Column(type: "nvarchar(450)", nullable: true), + Title = table.Column(type: "nvarchar(max)", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + ClassroomType = table.Column(type: "int", nullable: false), + Square = table.Column(type: "decimal(18,2)", nullable: false), + Capacity = table.Column(type: "int", nullable: false), + SecurityCode = table.Column(type: "nvarchar(max)", nullable: true), + HaveProjector = table.Column(type: "bit", nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Photo = table.Column(type: "varbinary(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs new file mode 100644 index 0000000..e87c719 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.Designer.cs @@ -0,0 +1,535 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.cs new file mode 100644 index 0000000..93b6d20 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403143118_AddDisciplines.cs @@ -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( + name: "UserName", + table: "Users", + type: "nvarchar(450)", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "Users", + type: "nvarchar(max)", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + + migrationBuilder.AlterColumn( + 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(type: "uniqueidentifier", nullable: false), + Title = table.Column(type: "nvarchar(450)", nullable: false), + DisciplineBlockUseForGrouping = table.Column(type: "bit", nullable: false), + DisciplineBlockOrder = table.Column(type: "int", nullable: false), + DisciplineBlockBlueAsteriskName = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DisciplineBlocks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Disciplines", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + DisciplineBlockId = table.Column(type: "uniqueidentifier", nullable: false), + DisciplineName = table.Column(type: "nvarchar(450)", nullable: false), + DisciplineShortName = table.Column(type: "nvarchar(max)", nullable: true), + DisciplineBlueAsteriskName = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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( + name: "UserName", + table: "Users", + type: "nvarchar(450)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "Users", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.AlterColumn( + 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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs new file mode 100644 index 0000000..b544385 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.Designer.cs @@ -0,0 +1,829 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.cs new file mode 100644 index 0000000..d173736 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210403180333_AddLecturers.cs @@ -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(type: "uniqueidentifier", nullable: false), + LecturerAcademicDegreeName = table.Column(type: "nvarchar(450)", nullable: false), + Order = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LecturerAcademicDegrees", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "LecturerAcademicRanks", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + LecturerAcademicRankName = table.Column(type: "nvarchar(450)", nullable: false), + Order = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LecturerAcademicRanks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "LecturerPosts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + LecturerPostName = table.Column(type: "nvarchar(450)", nullable: false), + Hours = table.Column(type: "int", nullable: false), + Order = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LecturerPosts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Lecturers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: false), + LecturerPostId = table.Column(type: "uniqueidentifier", nullable: false), + LecturerPostRate = table.Column(type: "decimal(18,2)", nullable: false), + LecturerAcademicRankId = table.Column(type: "uniqueidentifier", nullable: true), + LecturerAcademicDegreeId = table.Column(type: "uniqueidentifier", nullable: true), + LastName = table.Column(type: "nvarchar(450)", nullable: false), + FirstName = table.Column(type: "nvarchar(450)", nullable: false), + Patronymic = table.Column(type: "nvarchar(450)", nullable: true), + DateBirth = table.Column(type: "datetime2", nullable: false), + Address = table.Column(type: "nvarchar(max)", nullable: false), + Email = table.Column(type: "nvarchar(max)", nullable: false), + MobileNumber = table.Column(type: "nvarchar(max)", nullable: false), + HomeNumber = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Photo = table.Column(type: "varbinary(max)", nullable: true), + GroupElectricalSafety = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false), + LecturerId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeePostId = table.Column(type: "uniqueidentifier", nullable: false), + Rate = table.Column(type: "decimal(18,2)", nullable: false), + IsInternalCombination = table.Column(type: "bit", nullable: false), + IsExternalCombination = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs new file mode 100644 index 0000000..bf4a171 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs @@ -0,0 +1,832 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs new file mode 100644 index 0000000..1403755 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddLecturerAcademicDegreeDiscription : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Description", + table: "LecturerAcademicDegrees", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Description", + table: "LecturerAcademicDegrees"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs new file mode 100644 index 0000000..0dd5fca --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.Designer.cs @@ -0,0 +1,835 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.cs new file mode 100644 index 0000000..78cd851 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404065039_AddDiciplineDescription.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddDiciplineDescription : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Description", + table: "Disciplines", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Description", + table: "Disciplines"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs new file mode 100644 index 0000000..a18dc6e --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.Designer.cs @@ -0,0 +1,838 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.cs new file mode 100644 index 0000000..588148d --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070556_AddLecturer.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddLecturer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Abbreviation", + table: "Lecturers", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Abbreviation", + table: "Lecturers"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs new file mode 100644 index 0000000..51e79cf --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs @@ -0,0 +1,841 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs new file mode 100644 index 0000000..5995dc4 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddLecturerOnlyForPrivate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "OnlyForPrivate", + table: "Lecturers", + type: "bit", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "OnlyForPrivate", + table: "Lecturers"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs new file mode 100644 index 0000000..ffd3087 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.Designer.cs @@ -0,0 +1,845 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.cs new file mode 100644 index 0000000..dbdea3f --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210404170518_RemLecturerField.cs @@ -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( + name: "GroupElectricalSafety", + table: "Lecturers", + type: "nvarchar(max)", + nullable: true); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs new file mode 100644 index 0000000..a93d38c --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs @@ -0,0 +1,854 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployeePostId"); + + b.ToTable("EmployeeEmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostName") + .HasColumnType("nvarchar(450)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EmployeePostName") + .IsUnique() + .HasFilter("[EmployeePostName] IS NOT NULL"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeePostId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerPostName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerPostName") + .IsUnique(); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.cs new file mode 100644 index 0000000..dcb5929 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405060128_AddEnviromentSettingsFields.cs @@ -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( + name: "DateCreate", + table: "EnviromentSettings", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "DateDelete", + table: "EnviromentSettings", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + 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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs new file mode 100644 index 0000000..70b1619 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.Designer.cs @@ -0,0 +1,810 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.cs new file mode 100644 index 0000000..16b501d --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405080239_RemLecturerPost.cs @@ -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( + name: "IsExternalCombination", + table: "LecturerPosts", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "IsInternalCombination", + table: "LecturerPosts", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "LecturerId", + table: "LecturerPosts", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "PostId", + table: "LecturerPosts", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "Rate", + table: "LecturerPosts", + type: "decimal(18,2)", + nullable: false, + defaultValue: 0m); + + migrationBuilder.AddColumn( + name: "EmployeeId", + table: "EmployeePosts", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "IsExternalCombination", + table: "EmployeePosts", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "IsInternalCombination", + table: "EmployeePosts", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "PostId", + table: "EmployeePosts", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "Rate", + table: "EmployeePosts", + type: "decimal(18,2)", + nullable: false, + defaultValue: 0m); + + migrationBuilder.CreateTable( + name: "Posts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + PostName = table.Column(type: "nvarchar(450)", nullable: true), + Hours = table.Column(type: "int", nullable: true), + Order = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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( + name: "Hours", + table: "LecturerPosts", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "LecturerPostName", + table: "LecturerPosts", + type: "nvarchar(450)", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "Order", + table: "LecturerPosts", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "EmployeePostName", + table: "EmployeePosts", + type: "nvarchar(450)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Order", + table: "EmployeePosts", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "EmployeeEmployeePosts", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeePostId = table.Column(type: "uniqueidentifier", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + IsExternalCombination = table.Column(type: "bit", nullable: false), + IsInternalCombination = table.Column(type: "bit", nullable: false), + Rate = table.Column(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(type: "uniqueidentifier", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + EmployeePostId = table.Column(type: "uniqueidentifier", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + IsExternalCombination = table.Column(type: "bit", nullable: false), + IsInternalCombination = table.Column(type: "bit", nullable: false), + LecturerId = table.Column(type: "uniqueidentifier", nullable: false), + Rate = table.Column(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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs new file mode 100644 index 0000000..fb1294b --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.Designer.cs @@ -0,0 +1,813 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerPostRate") + .HasColumnType("decimal(18,2)"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.cs new file mode 100644 index 0000000..cba5bfb --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082110_AddFieldToLecturer.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class AddFieldToLecturer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "GroupElectricalSafety", + table: "Lecturers", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "GroupElectricalSafety", + table: "Lecturers"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs new file mode 100644 index 0000000..e3be792 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.Designer.cs @@ -0,0 +1,807 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.cs new file mode 100644 index 0000000..4dd64c7 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405082213_RemFieldToLecturer.cs @@ -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( + name: "LecturerPostId", + table: "Lecturers", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "LecturerPostRate", + table: "Lecturers", + type: "decimal(18,2)", + nullable: false, + defaultValue: 0m); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs new file mode 100644 index 0000000..3785c7e --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.Designer.cs @@ -0,0 +1,870 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.cs new file mode 100644 index 0000000..8422599 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405091403_AddEducationDirection.cs @@ -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( + 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(type: "uniqueidentifier", nullable: false), + Cipher = table.Column(type: "nvarchar(max)", nullable: false), + ShortName = table.Column(type: "nvarchar(max)", nullable: false), + Title = table.Column(type: "nvarchar(450)", nullable: false), + Profile = table.Column(type: "nvarchar(450)", nullable: true), + Qualification = table.Column(type: "nvarchar(max)", nullable: false), + LecturerId = table.Column(type: "uniqueidentifier", nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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( + 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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs new file mode 100644 index 0000000..d5da9f5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs @@ -0,0 +1,869 @@ +// +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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.cs new file mode 100644 index 0000000..5fcd215 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405095913_UPdFieldEducationDirection.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class UPdFieldEducationDirection : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Qualification", + table: "EducationDirections", + type: "int", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Qualification", + table: "EducationDirections", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(int), + oldType: "int"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs new file mode 100644 index 0000000..f46d6b2 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.Designer.cs @@ -0,0 +1,1131 @@ +// +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("20210405171658_AddAcademicPlans")] + partial class AddAcademicPlans + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("datetime2"); + + b.Property("YearFinish") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.cs new file mode 100644 index 0000000..c72df1a --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210405171658_AddAcademicPlans.cs @@ -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(type: "uniqueidentifier", nullable: false), + EducationDirectionId = table.Column(type: "uniqueidentifier", nullable: false), + YearEntrance = table.Column(type: "datetime2", nullable: false), + YearFinish = table.Column(type: "datetime2", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false), + DisciplineBlockId = table.Column(type: "uniqueidentifier", nullable: false), + TimeNormName = table.Column(type: "nvarchar(450)", nullable: false), + TimeNormShortName = table.Column(type: "nvarchar(max)", nullable: false), + TimeNormOrder = table.Column(type: "int", nullable: false), + TimeNormEducationDirectionQualification = table.Column(type: "int", nullable: true), + KindOfLoadName = table.Column(type: "nvarchar(max)", nullable: false), + KindOfLoadAttributeName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskAttributeName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskPracticName = table.Column(type: "nvarchar(max)", nullable: true), + UseInLearningProgress = table.Column(type: "bit", nullable: false), + UseInSite = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false), + AcademicPlanId = table.Column(type: "uniqueidentifier", nullable: false), + DisciplineId = table.Column(type: "uniqueidentifier", nullable: false), + InDepartment = table.Column(type: "bit", nullable: false), + Semester = table.Column(type: "int", nullable: false), + Zet = table.Column(type: "int", nullable: false), + AcademicPlanRecordParentId = table.Column(type: "uniqueidentifier", nullable: true), + IsParent = table.Column(type: "bit", nullable: false), + IsFacultative = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false), + AcademicPlanRecordId = table.Column(type: "uniqueidentifier", nullable: false), + TimeNormId = table.Column(type: "uniqueidentifier", nullable: false), + PlanHours = table.Column(type: "decimal(18,2)", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs new file mode 100644 index 0000000..9ed7d6a --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs @@ -0,0 +1,1131 @@ +// +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("20210406063922_UpdUniqueTimeNorm")] + partial class UpdUniqueTimeNorm + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("datetime2"); + + b.Property("YearFinish") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.cs new file mode 100644 index 0000000..5667df9 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406063922_UpdUniqueTimeNorm.cs @@ -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( + 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( + 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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs new file mode 100644 index 0000000..937cd72 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs @@ -0,0 +1,1131 @@ +// +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("20210406064319_ChangeTypeInacademicPlan")] + partial class ChangeTypeInacademicPlan + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.cs new file mode 100644 index 0000000..f19d001 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210406064319_ChangeTypeInacademicPlan.cs @@ -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( + name: "YearFinish", + table: "AcademicPlans", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + 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( + name: "YearEntrance", + table: "AcademicPlans", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + 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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs new file mode 100644 index 0000000..121ed59 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.Designer.cs @@ -0,0 +1,1130 @@ +// +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("20210408152438_ChangeAcademPlan")] + partial class ChangeAcademPlan + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.cs new file mode 100644 index 0000000..f90c94b --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210408152438_ChangeAcademPlan.cs @@ -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( + 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( + 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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs new file mode 100644 index 0000000..07ba8bb --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.Designer.cs @@ -0,0 +1,1187 @@ +// +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("20210412051258_AddStudentGroups")] + partial class AddStudentGroups + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + + b.Navigation("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.cs new file mode 100644 index 0000000..2b909c1 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412051258_AddStudentGroups.cs @@ -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(type: "uniqueidentifier", nullable: false), + AcademicPlanId = table.Column(type: "uniqueidentifier", nullable: false), + GroupNumber = table.Column(type: "int", nullable: false), + EnrollmentYear = table.Column(type: "int", nullable: false), + LecturerId = table.Column(type: "uniqueidentifier", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs new file mode 100644 index 0000000..e523bae --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.Designer.cs @@ -0,0 +1,1276 @@ +// +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("20210412101248_AddStudents")] + partial class AddStudents + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + + b.Navigation("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Department.StudentGroup", b => + { + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.cs new file mode 100644 index 0000000..9996ca7 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210412101248_AddStudents.cs @@ -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(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: false), + StudentGroupId = table.Column(type: "uniqueidentifier", nullable: false), + NumberOfBook = table.Column(type: "nvarchar(450)", nullable: false), + LastName = table.Column(type: "nvarchar(max)", nullable: false), + FirstName = table.Column(type: "nvarchar(max)", nullable: false), + Patronymic = table.Column(type: "nvarchar(max)", nullable: true), + Email = table.Column(type: "nvarchar(max)", nullable: false), + Description = table.Column(type: "nvarchar(max)", nullable: true), + StudentState = table.Column(type: "int", nullable: false), + Photo = table.Column(type: "varbinary(max)", nullable: true), + IsSteward = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs new file mode 100644 index 0000000..112d4d4 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.Designer.cs @@ -0,0 +1,1401 @@ +// +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("20210413070716_AddOrders")] + partial class AddOrders + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + + b.Navigation("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.cs new file mode 100644 index 0000000..363cffb --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210413070716_AddOrders.cs @@ -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(type: "uniqueidentifier", nullable: false), + OrderNumber = table.Column(type: "nvarchar(450)", nullable: false), + OrderDate = table.Column(type: "datetime2", nullable: false), + OrderType = table.Column(type: "int", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OrderStudentRecords", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + OrderId = table.Column(type: "uniqueidentifier", nullable: false), + StudentId = table.Column(type: "uniqueidentifier", nullable: false), + StudentGroupFromId = table.Column(type: "uniqueidentifier", nullable: true), + StudentGroupToId = table.Column(type: "uniqueidentifier", nullable: true), + OrderStudentMoveType = table.Column(type: "int", nullable: false), + Info = table.Column(type: "nvarchar(max)", nullable: true), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(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"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs new file mode 100644 index 0000000..52091b7 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs @@ -0,0 +1,1449 @@ +// +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("20210417172126_AddOrderSyncHistories")] + partial class AddOrderSyncHistories + { + 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.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + + b.Navigation("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.cs new file mode 100644 index 0000000..5a3463c --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210417172126_AddOrderSyncHistories.cs @@ -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(type: "uniqueidentifier", nullable: false), + SyncDate = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_OrderSyncHistories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OrderSyncHistoryRecords", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + OrderSyncHistoryId = table.Column(type: "uniqueidentifier", nullable: false), + Information = table.Column(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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs new file mode 100644 index 0000000..4230bfc --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.Designer.cs @@ -0,0 +1,1450 @@ +// +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("20210427134459_ChangeStudentGroups")] + partial class ChangeStudentGroups + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.5") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .IsRequired() + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicCourse") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("EducationDirectionId", "AcademicCourse", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("StudentGroups") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("EducationDirection"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.cs new file mode 100644 index 0000000..2e2d7df --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210427134459_ChangeStudentGroups.cs @@ -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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs new file mode 100644 index 0000000..3e1644c --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.Designer.cs @@ -0,0 +1,1454 @@ +// +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("20210428150932_UpdateStudnet")] + partial class UpdateStudnet + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.5") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Iduniv") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .IsRequired() + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicCourse") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("EducationDirectionId", "AcademicCourse", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("StudentGroups") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("EducationDirection"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.cs new file mode 100644 index 0000000..5767354 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210428150932_UpdateStudnet.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class UpdateStudnet : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Iduniv", + table: "Students", + type: "nvarchar(max)", + nullable: false, + defaultValue: ""); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Iduniv", + table: "Students"); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs new file mode 100644 index 0000000..4ab9cf3 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.Designer.cs @@ -0,0 +1,1453 @@ +// +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("20210430050931_UpdateStudnet2")] + partial class UpdateStudnet2 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.5") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Iduniv") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .IsRequired() + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicCourse") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("EducationDirectionId", "AcademicCourse", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("StudentGroups") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("EducationDirection"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.cs new file mode 100644 index 0000000..447e6ae --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430050931_UpdateStudnet2.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace CoreDatabase.Migrations +{ + public partial class UpdateStudnet2 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Email", + table: "Students", + type: "nvarchar(max)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Email", + table: "Students", + type: "nvarchar(max)", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldNullable: true); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs new file mode 100644 index 0000000..b6b7701 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.Designer.cs @@ -0,0 +1,1450 @@ +// +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("20210430051530_UpdateStudnet3")] + partial class UpdateStudnet3 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.5") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Iduniv") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicCourse") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("EducationDirectionId", "AcademicCourse", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId"); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("StudentGroups") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("EducationDirection"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.cs new file mode 100644 index 0000000..95c2d47 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/20210430051530_UpdateStudnet3.cs @@ -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( + 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( + 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); + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Migrations/DatabaseContextModelSnapshot.cs b/DepartmentPortal/Common/CoreDatabase/Migrations/DatabaseContextModelSnapshot.cs new file mode 100644 index 0000000..44ba888 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Migrations/DatabaseContextModelSnapshot.cs @@ -0,0 +1,1448 @@ +// +using System; +using CoreDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace CoreDatabase.Migrations +{ + [DbContext(typeof(DatabaseContext))] + partial class DatabaseContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.5") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("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("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("OrderNumber") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OrderType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique(); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderStudentMoveType") + .HasColumnType("int"); + + b.Property("StudentGroupFromId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentGroupToId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.HasIndex("StudentGroupFromId"); + + b.HasIndex("StudentGroupToId"); + + b.HasIndex("StudentId", "OrderId") + .IsUnique(); + + b.ToTable("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SyncDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("OrderSyncHistories"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Information") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrderSyncHistoryId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OrderSyncHistoryId"); + + b.ToTable("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Iduniv") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsSteward") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("NumberOfBook") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(max)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("StudentGroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("StudentState") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NumberOfBook") + .IsUnique(); + + b.HasIndex("StudentGroupId"); + + b.HasIndex("UserId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicCourse") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("EducationDirectionId", "AcademicCourse", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId"); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + 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.Department.OrderStudentRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.Order", "Order") + .WithMany("OrderStudentRecords") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") + .WithMany("OrderStudentRecordFroms") + .HasForeignKey("StudentGroupFromId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") + .WithMany("OrderStudentRecordTos") + .HasForeignKey("StudentGroupToId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("CoreDatabase.Models.Department.Student", "Student") + .WithMany("OrderStudentRecords") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Order"); + + b.Navigation("Student"); + + b.Navigation("StudentGroupFrom"); + + b.Navigation("StudentGroupTo"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => + { + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") + .WithMany("OrderSyncHistoryRecords") + .HasForeignKey("OrderSyncHistoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrderSyncHistory"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") + .WithMany("Students") + .HasForeignKey("StudentGroupId"); + + b.HasOne("CoreDatabase.Models.Security.User", "User") + .WithMany("Students") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("StudentGroup"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") + .WithMany("StudentGroups") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("EducationDirection"); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + 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.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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.Order", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => + { + b.Navigation("OrderSyncHistoryRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => + { + b.Navigation("OrderStudentRecords"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => + { + b.Navigation("OrderStudentRecordFroms"); + + b.Navigation("OrderStudentRecordTos"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + 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("Students"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs b/DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs new file mode 100644 index 0000000..af885b0 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/BaseEntity.cs @@ -0,0 +1,28 @@ +using System; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models +{ + /// + /// Базовый набор для сущности + /// + [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; + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlan.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlan.cs new file mode 100644 index 0000000..00d4ad4 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlan.cs @@ -0,0 +1,40 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class AcademicPlan : BaseEntity, IEntitySecurityExtenstion, IAcademicPlanModel + { + [DataMember] + public Guid? EducationDirectionId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public int YearEntrance { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public int YearFinish { get; set; } + + //------------------------------------------------------------------------- + + public virtual EducationDirection EducationDirection { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("AcademicPlanId")] + public virtual List AcademicPlanRecords { get; set; } + + //------------------------------------------------------------------------- + + public AcademicPlan SecurityCheck(AcademicPlan entity, bool allowFullData) => entity; + + public override string ToString() => $"{EducationDirection?.ShortName}({EducationDirection?.Profile}): {YearEntrance}-{YearFinish}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecord.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecord.cs new file mode 100644 index 0000000..6831b0c --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecord.cs @@ -0,0 +1,61 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class AcademicPlanRecord : BaseEntity, IEntitySecurityExtenstion, 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 AcademicPlanRecordTimeNormHours { get; set; } + + //------------------------------------------------------------------------- + + public AcademicPlanRecord SecurityCheck(AcademicPlanRecord entity, bool allowFullData) => entity; + + public override string ToString() => $"{Discipline} - {Semester + 1} семестр"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecordTimeNormHour.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecordTimeNormHour.cs new file mode 100644 index 0000000..5b3b5b9 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/AcademicPlanRecordTimeNormHour.cs @@ -0,0 +1,38 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class AcademicPlanRecordTimeNormHour : BaseEntity, IEntitySecurityExtenstion, 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}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Classroom.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Classroom.cs new file mode 100644 index 0000000..83a2209 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Classroom.cs @@ -0,0 +1,68 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Classroom : BaseEntity, IEntitySecurityExtenstion, 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; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Discipline.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Discipline.cs new file mode 100644 index 0000000..123d7ee --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Discipline.cs @@ -0,0 +1,48 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + /// + /// Класс, описывающий дисципилну кафедры + /// + [DataContract] + public class Discipline : BaseEntity, IEntitySecurityExtenstion, IDisciplineModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public Guid DisciplineBlockId { 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; } + + //------------------------------------------------------------------------- + + [ForeignKey("DisciplineId")] + public virtual List AcademicPlanRecords { get; set; } + + //------------------------------------------------------------------------- + + public Discipline SecurityCheck(Discipline entity, bool allowFullData) => entity; + + public override string ToString() => DisciplineName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/DisciplineBlock.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/DisciplineBlock.cs new file mode 100644 index 0000000..9b1711e --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/DisciplineBlock.cs @@ -0,0 +1,42 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class DisciplineBlock : BaseEntity, IEntitySecurityExtenstion, 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 Disciplines { get; set; } + + [ForeignKey("DisciplineBlockId")] + public virtual List TimeNorms { get; set; } + + //------------------------------------------------------------------------- + + public DisciplineBlock SecurityCheck(DisciplineBlock entity, bool allowFullData) => entity; + + public override string ToString() => Title; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/EducationDirection.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/EducationDirection.cs new file mode 100644 index 0000000..646cbd9 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/EducationDirection.cs @@ -0,0 +1,60 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + /// + /// Класс, описывающий направление обучения кафедры + /// + [DataContract] + public class EducationDirection : BaseEntity, IEntitySecurityExtenstion, 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 AcademicPlans { get; set; } + + [ForeignKey("EducationDirectionId")] + public virtual List StudentGroups { get; set; } + + //------------------------------------------------------------------------- + + public EducationDirection SecurityCheck(EducationDirection entity, bool allowFullData) => entity; + + public override string ToString() => $"{Cipher} {ShortName}({Profile})"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Employee.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Employee.cs new file mode 100644 index 0000000..64097b5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Employee.cs @@ -0,0 +1,83 @@ +using CoreModels.ModelsDepartment; +using CoreDatabase.Models.Security; +using ToolsModule.Extensions; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Employee : BaseEntity, IEntitySecurityExtenstion, 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 EmployeePosts { get; set; } + + [ForeignKey("EmployeeId")] + public virtual List 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)}"; + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/EmployeePost.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/EmployeePost.cs new file mode 100644 index 0000000..5851a13 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/EmployeePost.cs @@ -0,0 +1,40 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class EmployeePost : BaseEntity, IEntitySecurityExtenstion, 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}"; + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Lecturer.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Lecturer.cs new file mode 100644 index 0000000..1d856f8 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Lecturer.cs @@ -0,0 +1,110 @@ +using CoreModels.ModelsDepartment; +using CoreDatabase.Models.Security; +using ToolsModule.Extensions; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Lecturer : BaseEntity, IEntitySecurityExtenstion, 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 LecturerPosts { get; set; } + + [ForeignKey("LecturerId")] + public virtual List EducationDirections { get; set; } + + [ForeignKey("LecturerId")] + public virtual List StudentGroups { 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)}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicDegree.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicDegree.cs new file mode 100644 index 0000000..947e3e5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicDegree.cs @@ -0,0 +1,36 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class LecturerAcademicDegree : BaseEntity, IEntitySecurityExtenstion, 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 Lecturers { get; set; } + + //------------------------------------------------------------------------- + + public LecturerAcademicDegree SecurityCheck(LecturerAcademicDegree entity, bool allowFullData) => entity; + + public override string ToString() => LecturerAcademicDegreeName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicRank.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicRank.cs new file mode 100644 index 0000000..fbc52a3 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerAcademicRank.cs @@ -0,0 +1,33 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class LecturerAcademicRank : BaseEntity, IEntitySecurityExtenstion, ILecturerAcademicRankModel + { + [DataMember] + [Required] + public string LecturerAcademicRankName { get; set; } + + [DataMember] + public int Order { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + [ForeignKey("LecturerAcademicRankId")] + public virtual List Lecturers { get; set; } + + //------------------------------------------------------------------------- + + public LecturerAcademicRank SecurityCheck(LecturerAcademicRank entity, bool allowFullData) => entity; + + public override string ToString() => LecturerAcademicRankName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerPost.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerPost.cs new file mode 100644 index 0000000..8e148d6 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/LecturerPost.cs @@ -0,0 +1,44 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class LecturerPost : BaseEntity, IEntitySecurityExtenstion, 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}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Order.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Order.cs new file mode 100644 index 0000000..a6a2992 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Order.cs @@ -0,0 +1,40 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Order : BaseEntity, IEntitySecurityExtenstion, 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 OrderStudentRecords { get; set; } + + //------------------------------------------------------------------------- + + public Order SecurityCheck(Order entity, bool allowFullData) => entity; + + public override string ToString() => $"№{OrderNumber} от {OrderDate.ToShortDateString()}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderStudentRecord.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderStudentRecord.cs new file mode 100644 index 0000000..e1d0997 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderStudentRecord.cs @@ -0,0 +1,61 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion, IOrderStudentRecordModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public Guid OrderId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public Guid StudentId { get; set; } + + [DataMember] + public Guid? StudentGroupFromId { get; set; } + + [DataMember] + public Guid? StudentGroupToId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public OrderStudentMoveType OrderStudentMoveType { get; set; } + + [DataMember] + public string Info { get; set; } + + //------------------------------------------------------------------------- + + public virtual Order Order { get; set; } + + public virtual Student Student { get; set; } + + public virtual StudentGroup StudentGroupFrom { get; set; } + + public virtual StudentGroup StudentGroupTo { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public OrderStudentRecord SecurityCheck(OrderStudentRecord entity, bool allowFullData) + { + if (!allowFullData) + { + entity.Info = string.Empty; + entity.OrderStudentMoveType = 0; + } + + return entity; + } + + public override string ToString() => $"{Student} {OrderStudentMoveType}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistory.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistory.cs new file mode 100644 index 0000000..bae30c5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistory.cs @@ -0,0 +1,31 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class OrderSyncHistory : IdEntity, IEntitySecurityExtenstion, IOrderSyncHistoryModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public DateTime SyncDate { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + [ForeignKey("OrderSyncHistoryId")] + public virtual List OrderSyncHistoryRecords { get; set; } + + //------------------------------------------------------------------------- + + public OrderSyncHistory SecurityCheck(OrderSyncHistory entity, bool allowFullData) => entity; + + public override string ToString() => SyncDate.ToShortDateString(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistoryRecord.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistoryRecord.cs new file mode 100644 index 0000000..e0e0792 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/OrderSyncHistoryRecord.cs @@ -0,0 +1,40 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class OrderSyncHistoryRecord : IdEntity, IEntitySecurityExtenstion, IOrderSyncHistoryRecordModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public Guid OrderSyncHistoryId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public string Information { get; set; } + + //------------------------------------------------------------------------- + + public virtual OrderSyncHistory OrderSyncHistory { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public OrderSyncHistoryRecord SecurityCheck(OrderSyncHistoryRecord entity, bool allowFullData) + { + if (!allowFullData) + { + entity.Information = "скрыто"; + } + + return entity; + } + + public override string ToString() => Information; + } +} diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Post.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Post.cs new file mode 100644 index 0000000..88db813 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Post.cs @@ -0,0 +1,37 @@ +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Post : BaseEntity, IEntitySecurityExtenstion, IPostModel + { + [DataMember] + public string PostName { get; set; } + + [DataMember] + public int? Hours { get; set; } + + [DataMember] + public int Order { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + [ForeignKey("PostId")] + public virtual List EmployeePosts { get; set; } + + [ForeignKey("PostId")] + public virtual List LecturerPosts { get; set; } + + //------------------------------------------------------------------------- + + public Post SecurityCheck(Post entity, bool allowFullData) => entity; + + public override string ToString() => PostName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/Student.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/Student.cs new file mode 100644 index 0000000..7f8fd9b --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/Student.cs @@ -0,0 +1,86 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using CoreDatabase.Models.Security; +using ToolsModule.Extensions; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class Student : BaseEntity, IEntitySecurityExtenstion, IStudentModel + { + [DataMember] + [Required] + public Guid UserId { get; set; } + + [DataMember] + public Guid? StudentGroupId { get; set; } + + [DataMember] + [Required] + public string Iduniv { get; set; } + + [DataMember] + [Required] + public string NumberOfBook { 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 Email { get; set; } + + [DataMember] + public string Description { get; set; } + + [Required(ErrorMessage = "required")] + public StudentState StudentState { get; set; } + + [DataMember] + public byte[] Photo { get; set; } + + [DataMember] + public bool IsSteward { get; set; } + + //------------------------------------------------------------------------- + + public virtual User User { get; set; } + + public virtual StudentGroup StudentGroup { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("StudentId")] + public virtual List OrderStudentRecords { get; set; } + + //------------------------------------------------------------------------- + + public Student SecurityCheck(Student entity, bool allowFullData) + { + if (!allowFullData) + { + entity.NumberOfBook = Guid.NewGuid().ToString(); + entity.Email = "скрыто"; + entity.Photo = null; + } + + return entity; + } + + public override string ToString() => + $"{LastName}{(FirstName.IsNotEmpty() ? $" {FirstName[0]}." : string.Empty)}{(Patronymic.IsNotEmpty() ? $"{Patronymic[0]}." : string.Empty)}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/StudentGroup.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/StudentGroup.cs new file mode 100644 index 0000000..a2df439 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/StudentGroup.cs @@ -0,0 +1,59 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class StudentGroup : BaseEntity, IEntitySecurityExtenstion, IStudentGroupModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public Guid EducationDirectionId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public int GroupNumber { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public AcademicCourse AcademicCourse { get; set; } + + [DataMember] + public Guid? LecturerId { get; set; } + + //------------------------------------------------------------------------- + + public virtual EducationDirection EducationDirection { get; set; } + + public virtual Lecturer Lecturer { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("StudentGroupId")] + public virtual List Students { get; set; } + + [ForeignKey("StudentGroupFromId")] + public virtual List OrderStudentRecordFroms { get; set; } + + [ForeignKey("StudentGroupToId")] + public virtual List OrderStudentRecordTos { get; set; } + + //------------------------------------------------------------------------- + + public StudentGroup SecurityCheck(StudentGroup entity, bool allowFullData) => entity; + + public override string ToString() => $"{EducationDirection?.ShortName}-{AcademicCourse}{GroupNumber}"; + + public int GetStudnetsByState(StudentState state) + { + return Students?.Where(x => x.StudentState == state)?.Count() ?? 0; + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Department/TimeNorm.cs b/DepartmentPortal/Common/CoreDatabase/Models/Department/TimeNorm.cs new file mode 100644 index 0000000..d49f400 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Department/TimeNorm.cs @@ -0,0 +1,71 @@ +using CoreModels.Enums.Department; +using CoreModels.ModelsDepartment; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Department +{ + [DataContract] + public class TimeNorm : BaseEntity, IEntitySecurityExtenstion, ITimeNormModel + { + [DataMember] + [Required(ErrorMessage = "required")] + public Guid DisciplineBlockId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public string TimeNormName { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public string TimeNormShortName { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public int TimeNormOrder { get; set; } + + [DataMember] + public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + public string KindOfLoadName { get; set; } + + [DataMember] + public string KindOfLoadAttributeName { get; set; } + + [DataMember] + public string KindOfLoadBlueAsteriskName { get; set; } + + [DataMember] + public string KindOfLoadBlueAsteriskAttributeName { get; set; } + + [DataMember] + public string KindOfLoadBlueAsteriskPracticName { get; set; } + + [DataMember] + public bool UseInLearningProgress { get; set; } + + [DataMember] + public bool UseInSite { get; set; } + + //------------------------------------------------------------------------- + + public virtual DisciplineBlock DisciplineBlock { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("TimeNormId")] + public virtual List AcademicPlanRecordTimeNormHours { get; set; } + + //------------------------------------------------------------------------- + + public TimeNorm SecurityCheck(TimeNorm entity, bool allowFullData) => entity; + + public override string ToString() => TimeNormName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/IdEntity.cs b/DepartmentPortal/Common/CoreDatabase/Models/IdEntity.cs new file mode 100644 index 0000000..a47753f --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/IdEntity.cs @@ -0,0 +1,24 @@ +using ToolsModule.Attributes; +using System; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models +{ + /// + /// Тип Id для всеъ сущностей + /// + [DataContract] + public class IdEntity + { + [DataMember] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [MapConfiguration("Id")] + public Guid Id { get; set; } + + public IdEntity() : base() + { + Id = Guid.NewGuid(); + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Security/Access.cs b/DepartmentPortal/Common/CoreDatabase/Models/Security/Access.cs new file mode 100644 index 0000000..8483ffc --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Security/Access.cs @@ -0,0 +1,44 @@ +using CoreModels.ModelsSecurity; +using ToolsModule.Enums; +using ToolsModule.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Security +{ + [DataContract] + public class Access : BaseEntity, IEntitySecurityExtenstion, IAccessModel + { + [DataMember] + [Required] + public Guid RoleId { get; set; } + + [DataMember] + [Required] + public AccessOperation AccessOperation { get; set; } + + [DataMember] + [Required] + public AccessType AccessType { get; set; } + + //------------------------------------------------------------------------- + + public virtual Role Role { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public Access SecurityCheck(Access entity, bool allowFullData) + { + if (!allowFullData) + { + entity.AccessType = AccessType.View; + } + return entity; + } + + public override string ToString() => $"{Role.RoleName}-{AccessOperation:G}({AccessType:G})"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Security/EnviromentSetting.cs b/DepartmentPortal/Common/CoreDatabase/Models/Security/EnviromentSetting.cs new file mode 100644 index 0000000..8b1b7c1 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Security/EnviromentSetting.cs @@ -0,0 +1,39 @@ +using CoreModels.ModelsSecurity; +using ToolsModule.Interfaces; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Security +{ + [DataContract] + public class EnviromentSetting : BaseEntity, IEntitySecurityExtenstion, IEnviromentSettingModel + { + [DataMember] + [Required] + public string Key { get; set; } + + [DataMember] + [Required] + public string Value { get; set; } + + [DataMember] + public string Description { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public EnviromentSetting SecurityCheck(EnviromentSetting entity, bool allowFullData) + { + if (!allowFullData) + { + entity.Value = "скрыто"; + } + return entity; + } + + public override string ToString() => Key; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Security/Role.cs b/DepartmentPortal/Common/CoreDatabase/Models/Security/Role.cs new file mode 100644 index 0000000..3dd2383 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Security/Role.cs @@ -0,0 +1,37 @@ +using CoreModels.ModelsSecurity; +using ToolsModule.Interfaces; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Security +{ + [DataContract] + public class Role : BaseEntity, IEntitySecurityExtenstion, IRoleModel + { + [DataMember] + [Required] + public string RoleName { get; set; } + + [DataMember] + public int RolePriority { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + [ForeignKey("RoleId")] + public virtual List Access { get; set; } + + [ForeignKey("RoleId")] + public virtual List UserRoles { get; set; } + + //------------------------------------------------------------------------- + + public Role SecurityCheck(Role entity, bool allowFullData) => entity; + + public override string ToString() => RoleName; + + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Security/User.cs b/DepartmentPortal/Common/CoreDatabase/Models/Security/User.cs new file mode 100644 index 0000000..e55008e --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Security/User.cs @@ -0,0 +1,74 @@ +using CoreModels.ModelsSecurity; +using CoreDatabase.Models.Department; +using ToolsModule.Attributes; +using ToolsModule.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Security +{ + [DataContract] + public class User : BaseEntity, IEntitySecurityExtenstion, IUserModel + { + [DataMember] + [Required] + public string UserName { get; set; } + + [DataMember] + [Required] + public string PasswordHash { get; set; } + + [DataMember] + public byte[] Avatar { get; set; } + + [DataMember] + public DateTime? DateLastVisit { get; set; } + + [DataMember] + public bool IsBanned { get; set; } + + [DataMember] + public DateTime? DateBanned { get; set; } + + [DataMember] + public int CountAttempt { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + [ForeignKey("UserId")] + public virtual List UserRoles { get; set; } + + [ForeignKey("UserId")] + public virtual List Employees { get; set; } + + [ForeignKey("UserId")] + public virtual List Lecturers { get; set; } + + [ForeignKey("UserId")] + public virtual List Students { get; set; } + + //------------------------------------------------------------------------- + + public User SecurityCheck(User entity, bool allowFullData) + { + if (!allowFullData) + { + entity.PasswordHash = SecurityManager.GetPasswordHash("qwerty"); + entity.Avatar = null; + entity.IsBanned = false; + entity.DateBanned = null; + entity.CountAttempt = 0; + entity.DateLastVisit = null; + } + + return entity; + } + + public override string ToString() => UserName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Models/Security/UserRole.cs b/DepartmentPortal/Common/CoreDatabase/Models/Security/UserRole.cs new file mode 100644 index 0000000..ab6e132 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Models/Security/UserRole.cs @@ -0,0 +1,31 @@ +using CoreModels.ModelsSecurity; +using ToolsModule.Interfaces; +using System; +using System.Runtime.Serialization; + +namespace CoreDatabase.Models.Security +{ + [DataContract] + public class UserRole : BaseEntity, IEntitySecurityExtenstion, IUserRoleModel + { + [DataMember] + public Guid RoleId { get; set; } + + [DataMember] + public Guid UserId { get; set; } + + //------------------------------------------------------------------------- + + public virtual Role Role { get; set; } + + public virtual User User { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public UserRole SecurityCheck(UserRole entity, bool allowFullData) => entity; + + public override string ToString() => $"{Role.RoleName}-{User.UserName}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Scripts/DepartmentMigrationScript.cs b/DepartmentPortal/Common/CoreDatabase/Scripts/DepartmentMigrationScript.cs new file mode 100644 index 0000000..3a51547 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Scripts/DepartmentMigrationScript.cs @@ -0,0 +1,129 @@ +using Microsoft.EntityFrameworkCore; + +namespace CoreDatabase.Scripts +{ + /// + /// Скрипты для миграции данных по кафедре + /// + public static class DepartmentMigrationScript + { + private static readonly string clearMigration = +@"DELETE FROM [DepartmentDatabasePortal].[dbo].[Classrooms]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[DisciplineBlocks]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Disciplines]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Posts]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Lecturers]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[TimeNorms]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlans]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlanRecords]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlanRecordTimeNormHours]; +GO"; + + private static readonly string classroomsMigration = +@"DECLARE @employeeId uniqueidentifier; + +SELECT @employeeId = emp.[Id] FROM [DepartmentDatabasePortal].[dbo].[Employees] emp + +INSERT INTO [DepartmentDatabasePortal].[dbo].[Classrooms]([Id],[Number],[EmployeeId],[ClassroomType],[Square],[Capacity],[HaveProjector],[SecurityCode], +[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[Number],@employeeId,[ClassroomType],1,[Capacity],0,'-',[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Classrooms]"; + + private static readonly string disciplineBlockMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[DisciplineBlocks]([Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder], +[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder],[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] FROM +[DepartmentDatabaseContext].[dbo].[DisciplineBlocks]"; + + private static readonly string disciplineMigration = +@"DELETE FROM [DepartmentDatabaseContext].[dbo].[Disciplines] WHERE [Id]='6CC684D5-900C-4278-AA43-0B83D0711C55' OR [Id]='A6598227-8449-4884-8290-13EABEC26924' + OR [Id]='4581ADC8-5A15-4F95-A40D-1607856ACB5C' OR [Id]='9DA4D810-025A-4A03-81FD-293DEF52FA4B' -- дублт в дисципдинах + +INSERT INTO [DepartmentDatabasePortal].[dbo].[Disciplines]([Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[Description], +[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[DisciplineDescription],[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] +FROM [DepartmentDatabaseContext].[dbo].[Disciplines]"; + + private static readonly string postMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[Posts]([Id],[PostName],[Hours],[Order],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[StudyPostTitle],[Hours],1,[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[LecturerStudyPosts]"; + + private static readonly string lecturerMigration = +@"DECLARE @userId uniqueidentifier; + +SELECT @userId = u.[Id] FROM [DepartmentDatabasePortal].[dbo].[Users] u WHERE u.[UserName]='admin' + +INSERT INTO [DepartmentDatabasePortal].[dbo].[Lecturers]([Id],[UserId],[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email], +[MobileNumber],[HomeNumber],[Description],[Photo],[GroupElectricalSafety],[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],@userId,[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email],[MobileNumber],[HomeNumber],[Description],[Photo],'I', +[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Lecturers]"; + + private static readonly string educationdirectionrMigration = +@"DECLARE @lecturerId uniqueidentifier; + +SELECT @lecturerId = l.[Id] FROM [DepartmentDatabasePortal].[dbo].[Lecturers] l + +INSERT INTO [DepartmentDatabasePortal].[dbo].[EducationDirections]([Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],[LecturerId],[Description], +[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],@lecturerId,[Description],[DateCreate],[DateDelete],[IsDeleted] FROM +[DepartmentDatabaseContext].[dbo].[EducationDirections]"; + + private static readonly string timeNormMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[TimeNorms]([Id],[DisciplineBlockId],[TimeNormName],[TimeNormShortName] + ,[TimeNormOrder],[TimeNormEducationDirectionQualification],[KindOfLoadName],[KindOfLoadAttributeName],[KindOfLoadBlueAsteriskName] + ,[KindOfLoadBlueAsteriskAttributeName],[KindOfLoadBlueAsteriskPracticName],[UseInLearningProgress],[UseInSite],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[DisciplineBlockId],[TimeNormName],[TimeNormShortName],[TimeNormOrder],[TimeNormEducationDirectionQualification],[KindOfLoadName] + ,[KindOfLoadAttributeName],[KindOfLoadBlueAsteriskName],[KindOfLoadBlueAsteriskAttributeName],[KindOfLoadBlueAsteriskPracticName] + ,[UseInLearningProgress],[UseInSite],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[TimeNorms] WHERE +[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlans]([Id],[EducationDirectionId],[YearEntrance],[YearFinish],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[EducationDirectionId],2020 + ABS(CHECKSUM(NEWID()) % 100),2024,[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[AcademicPlans] WHERE +[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanrecordsMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlanRecords]([Id],[AcademicPlanId],[DisciplineId],[InDepartment],[Semester],[Zet] + ,[AcademicPlanRecordParentId],[IsParent],[IsFacultative],[DateCreate],[DateDelete],[IsDeleted]) +SELECT apr.[Id],apr.[AcademicPlanId],apr.[DisciplineId],apr.[InDepartment],apr.[Semester],apr.[Zet],apr.[AcademicPlanRecordParentId],apr.[IsParent],apr.[IsFacultative] + ,apr.[DateCreate],apr.[DateDelete],apr.[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[AcademicPlanRecords] apr +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlans] ap on apr.[AcademicPlanId]=ap.[Id] WHERE +ap.[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanrecordhoursMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlanRecordTimeNormHours]([Id],[AcademicPlanRecordId],[TimeNormId],[PlanHours],[DateCreate],[DateDelete], + [IsDeleted]) +SELECT apre.[Id],apre.[AcademicPlanRecordId],apre.[TimeNormId],apre.[PlanHours],apre.[DateCreate],apre.[DateDelete],apre.[IsDeleted] +FROM [DepartmentDatabaseContext].[dbo].[AcademicPlanRecordElements] apre +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlanRecords] apr on apre.[AcademicPlanRecordId]=apr.[Id] +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlans] ap on apr.[AcademicPlanId]=ap.[Id] WHERE +ap.[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + /// + /// Перенос данных по безопасности + /// + /// + public static void RunScript(DbContext context) + { + context.Database.ExecuteSqlRaw(clearMigration, null); + + context.Database.ExecuteSqlRaw(classroomsMigration, null); + context.Database.ExecuteSqlRaw(disciplineBlockMigration, null); + context.Database.ExecuteSqlRaw(disciplineMigration, null); + context.Database.ExecuteSqlRaw(postMigration, null); + context.Database.ExecuteSqlRaw(lecturerMigration, null); + context.Database.ExecuteSqlRaw(educationdirectionrMigration, null); + context.Database.ExecuteSqlRaw(timeNormMigration, null); + context.Database.ExecuteSqlRaw(academicplanMigration, null); + context.Database.ExecuteSqlRaw(academicplanrecordsMigration, null); + context.Database.ExecuteSqlRaw(academicplanrecordhoursMigration, null); + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/Scripts/SecureMigrationScript.cs b/DepartmentPortal/Common/CoreDatabase/Scripts/SecureMigrationScript.cs new file mode 100644 index 0000000..52b3ac5 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/Scripts/SecureMigrationScript.cs @@ -0,0 +1,57 @@ +using Microsoft.EntityFrameworkCore; + +namespace CoreDatabase.Scripts +{ + /// + /// Скрипты для миграции данных по безопасности + /// + public static class SecureMigrationScript + { + private static readonly string clearMigration = +@"DELETE FROM [DepartmentDatabasePortal].[dbo].[EnviromentSettings]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Accesses]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[UserRoles]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Users]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[Roles]; +GO"; + + private static readonly string roleMigration = +@"INSERT INTO DepartmentDatabasePortal.dbo.Roles(Id, RoleName, RolePriority, DateCreate, DateDelete, IsDeleted) +SELECT Id, RoleName, RolePriority, DateCreate, DateDelete, IsDeleted FROM DepartmentDatabaseContext.dbo.DepartmentRoles"; + + private static readonly string userMigration = +@"INSERT INTO DepartmentDatabasePortal.dbo.Users(Id, UserName, PasswordHash, Avatar, DateLastVisit, IsBanned, DateBanned, CountAttempt, DateCreate, DateDelete, IsDeleted) +SELECT Id, UserName, PasswordHash, Avatar, DateLastVisit, IsLocked, DateBanned, CountAttempt, DateCreate, DateDelete, IsDeleted FROM DepartmentDatabaseContext.dbo.DepartmentUsers"; + + private static readonly string userroleMigration = +@"INSERT INTO DepartmentDatabasePortal.dbo.UserRoles(Id, UserId, RoleId, DateCreate, DateDelete, IsDeleted) +SELECT Id, UserId, RoleId, DateCreate, DateDelete, IsDeleted FROM DepartmentDatabaseContext.dbo.DepartmentUserRoles"; + + private static readonly string accessMigration = +@"INSERT INTO DepartmentDatabasePortal.dbo.Accesses(Id, Operation, AccessType, RoleId, DateCreate, DateDelete, IsDeleted) +SELECT Id, Operation, AccessType, RoleId, DateCreate, DateDelete, IsDeleted FROM DepartmentDatabaseContext.dbo.DepartmentAccesses"; + + private static readonly string enviromentsettingMigration = +@"INSERT INTO DepartmentDatabasePortal.dbo.EnviromentSettings(Id, [Key], [Value]) +SELECT NEWID(), [Key], [Value] FROM DepartmentDatabaseContext.dbo.CurrentSettings"; + + /// + /// Перенос данных по безопасности + /// + /// + public static void RunScript(DbContext context) + { + context.Database.ExecuteSqlRaw(clearMigration, null); + + context.Database.ExecuteSqlRaw(roleMigration, null); + context.Database.ExecuteSqlRaw(userMigration, null); + context.Database.ExecuteSqlRaw(userroleMigration, null); + context.Database.ExecuteSqlRaw(accessMigration, null); + context.Database.ExecuteSqlRaw(enviromentsettingMigration, null); + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/CoreDatabase/SecurityManager.cs b/DepartmentPortal/Common/CoreDatabase/SecurityManager.cs new file mode 100644 index 0000000..0a89367 --- /dev/null +++ b/DepartmentPortal/Common/CoreDatabase/SecurityManager.cs @@ -0,0 +1,237 @@ +using CoreDatabase.Models.Security; +using ToolsModule.Enums; +using ToolsModule.Interfaces; +using ToolsModule.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace CoreDatabase +{ + public class SecurityManager : ISecurityManager + { + private readonly int _countDayToBanned = 3; + + private readonly int _countMaxAttempt = 3; + + public Guid? User { get; set; } + + public List Roles { get; set; } + + public string ErrorMessage { get; set; } + + public bool IsAuth => User != null; + + public bool CheckAccess(SecurityManagerCheckAccessModel model) + { + using var context = DatabaseManager.GetContext; + Access access = null; + if (model.Model != null) + { + // если не указан идентификатор пользователя, то смотрим, может он авторизован + if (!model.Model.UserIdForAccess.HasValue && User.HasValue) + { + model.Model.UserIdForAccess = User.Value; + } + + var roles = context.UserRoles.Where(x => x.UserId == model.Model.UserIdForAccess && !x.IsDeleted).Select(x => x.Role).OrderByDescending(x => x.RolePriority).ToList(); + if (roles == null) + { + ErrorMessage = $"Не верный пользователь"; + return false; + } + access = context.Accesses.FirstOrDefault(a => a.AccessOperation == model.Operation && roles.Contains(a.Role)); + } + else if (Roles != null) + { + access = context.Accesses.FirstOrDefault(a => a.AccessOperation == model.Operation && Roles.Contains(a.RoleId)); + } + if (access != null) + { + if (access.AccessType >= model.Type) return true; + } + switch (model.Type) + { + case AccessType.View: + ErrorMessage = $"Нет доступа на чтение данных по сущности '{model.Entity}'"; + return false; + case AccessType.Change: + ErrorMessage = $"Нет доступа на изменение данных по сущности '{model.Entity}'"; + return false; + case AccessType.Delete: + ErrorMessage = $"Нет доступа на удаление данных по сущности '{model.Entity}'"; + return false; + default: + ErrorMessage = $"Нет доступа по сущности '{model.Entity}'"; + return false; + } + } + + public void CheckStartDataSource() + { + using var context = DatabaseManager.GetContext; + using var transaction = context.Database.BeginTransaction(); + var role = context.Roles.FirstOrDefault(x => x.RoleName == "Администратор"); + if (role == null) + { + role = new Role + { + RoleName = "Администратор", + RolePriority = 100 + }; + context.Roles.Add(role); + context.SaveChanges(); + } + + var accesses = context.Accesses.Where(x => x.RoleId == role.Id); + foreach (AccessOperation operation in Enum.GetValues(typeof(AccessOperation))) + { + if (!accesses.Any(x => x.AccessOperation == operation && x.AccessType == AccessType.Delete)) + { + context.Accesses.Add(new Access + { + AccessOperation = operation, + AccessType = AccessType.Delete, + RoleId = role.Id + }); + } + } + context.SaveChanges(); + + var md5 = new MD5CryptoServiceProvider(); + var user = context.Users.FirstOrDefault(x => x.UserName == "admin"); + if (user == null) + { + user = new User + { + UserName = "admin", + PasswordHash = Encoding.ASCII.GetString(md5.ComputeHash(Encoding.ASCII.GetBytes("qwerty"))), + CountAttempt = 0 + }; + context.Users.Add(user); + context.SaveChanges(); + } + var link = context.UserRoles.FirstOrDefault(x => x.RoleId == role.Id && x.UserId == user.Id); + if (link == null) + { + context.UserRoles.Add(new UserRole + { + RoleId = role.Id, + UserId = user.Id + }); + context.SaveChanges(); + } + + List enviromentKeys = new() + { + "Практика", + "Учебный год", + "Даты семестра", + "Дисциплины (модули)", + "Кафедра", + "ГИА", + "SyncStudentOrderIpAddress", + "SyncStudentOrderUserName", + "SyncStudentOrderPassword" + }; + foreach(var key in enviromentKeys) + { + var es = context.EnviromentSettings.FirstOrDefault(x => x.Key == key); + if(es == null) + { + context.EnviromentSettings.Add(new EnviromentSetting + { + Key = key, + Value = "Прописать значение!" + }); + } + } + context.SaveChanges(); + + transaction.Commit(); + } + + public async Task LoginAsync(string login, string password) + { + var passwordHash = GetPasswordHash(password); + using var context = DatabaseManager.GetContext; + var user = context.Users.FirstOrDefault(x => x.UserName == login && x.PasswordHash == passwordHash && !x.IsDeleted); + await CheckUserAsync(login, user, context); + user.DateLastVisit = DateTime.Now; + user.CountAttempt = 0; + await context.SaveChangesAsync(); + + User = user.Id; + Roles = context.UserRoles.Where(x => x.UserId == user.Id && !x.IsDeleted).Select(x => x.RoleId).ToList(); + } + + public async Task LogoutAsync() + { + await Task.Run(() => + { + User = null; + Roles = null; + }); + } + + public async Task ChangePassword(string login, string oldPassword, string newPassword) + { + using var context = DatabaseManager.GetContext; + var user = context.Users.FirstOrDefault(x => x.UserName == login && x.PasswordHash == GetPasswordHash(oldPassword) && !x.IsDeleted); + await CheckUserAsync(login, user, context); + user.PasswordHash = GetPasswordHash(newPassword); + await context.SaveChangesAsync(); + } + + /// + /// Получение хеша пароля + /// + /// + /// + public static string GetPasswordHash(string password) => Encoding.ASCII.GetString((new MD5CryptoServiceProvider()).ComputeHash(Encoding.ASCII.GetBytes(password))); + + /// + /// Проверка пользователя при авторизации и при смене пароля + /// + /// + /// + /// + /// + private async Task CheckUserAsync(string login, User user, DatabaseContext context) + { + if (user == null) + { + user = context.Users.FirstOrDefault(x => x.UserName == login && !x.IsDeleted); + if (user != null) + { + user.CountAttempt++; + if (user.CountAttempt > _countMaxAttempt) + { + user.IsBanned = true; + user.DateBanned = DateTime.Now; + await context.SaveChangesAsync(); + + throw new Exception($"Введен неверный логин/пароль? учетная запись заблоикрована на {_countDayToBanned} дней(я)"); + } + } + + throw new Exception("Введен неверный логин/пароль"); + } + if (user.IsBanned) + { + if (user.DateBanned.Value.AddDays(_countDayToBanned) > DateTime.Now) + { + user.IsBanned = false; + await context.SaveChangesAsync(); + } + else + { + throw new Exception("Пользователь заблокирован"); + } + } + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/AbstractGenerticEntityService.cs b/DepartmentPortal/Common/DatabaseCore/AbstractGenerticEntityService.cs index 7dc6dcf..9611160 100644 --- a/DepartmentPortal/Common/DatabaseCore/AbstractGenerticEntityService.cs +++ b/DepartmentPortal/Common/DatabaseCore/AbstractGenerticEntityService.cs @@ -1,4 +1,4 @@ -using DatabaseCore.Models; +using CoreDatabase.Models; using Microsoft.EntityFrameworkCore; using ToolsModule.BindingModels; using ToolsModule.BusinessLogics; @@ -9,7 +9,7 @@ using ToolsModule.ViewModels; using System; using System.Linq; -namespace DatabaseCore +namespace CoreDatabase { public abstract class AbstractGenerticEntityService : IGenerticEntityService where G : GetBindingModel diff --git a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs index 25b0a3f..465d196 100644 --- a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs +++ b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs @@ -1,8 +1,8 @@ -using DatabaseCore.Models.Department; -using DatabaseCore.Models.Security; +using CoreDatabase.Models.Department; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; -namespace DatabaseCore +namespace CoreDatabase { public class DatabaseContext : DbContext { diff --git a/DepartmentPortal/Common/DatabaseCore/DatabaseManager.cs b/DepartmentPortal/Common/DatabaseCore/DatabaseManager.cs index 6bdd322..f3758b5 100644 --- a/DepartmentPortal/Common/DatabaseCore/DatabaseManager.cs +++ b/DepartmentPortal/Common/DatabaseCore/DatabaseManager.cs @@ -1,4 +1,4 @@ -namespace DatabaseCore +namespace CoreDatabase { /// /// Работа с БД diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.Designer.cs index e9c7b52..6b141db 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210326072923_AddSecurityModels")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -51,7 +51,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -67,7 +67,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -92,7 +92,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -144,7 +144,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -164,9 +164,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -175,15 +175,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -194,14 +194,14 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.cs index 04aafc8..f2b5094 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210326072923_AddSecurityModels.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddSecurityModels : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.Designer.cs index 755f5e4..b4af9e9 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210327194001_ChangeSecurityFields")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -51,7 +51,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -67,7 +67,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -92,7 +92,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -141,7 +141,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -170,9 +170,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -181,15 +181,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -200,14 +200,14 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.cs index 4b37ee3..6e75066 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210327194001_ChangeSecurityFields.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class ChangeSecurityFields : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs index 4ac44f7..3dca87d 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210328165041_AddDescriptionInEnviromentSettings")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -51,7 +51,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -70,7 +70,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -95,7 +95,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -144,7 +144,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -173,9 +173,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -184,15 +184,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -203,14 +203,14 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs index 0a1be8c..e4bac25 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210328165041_AddDescriptionInEnviromentSettings.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddDescriptionInEnviromentSettings : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.Designer.cs index 8c0d54c..fb889d8 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210401105731_UpdateSecurityModels")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -51,7 +51,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -75,7 +75,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -100,7 +100,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -140,7 +140,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -169,9 +169,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -180,15 +180,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -199,14 +199,14 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.cs index 08ca627..387ff49 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210401105731_UpdateSecurityModels.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UpdateSecurityModels : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.Designer.cs index 5e186e6..3671c84 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210403054350_AddEmployee")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -80,7 +80,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -118,7 +118,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -147,7 +147,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -177,7 +177,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -201,7 +201,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -230,7 +230,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -274,7 +274,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -303,15 +303,15 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -322,9 +322,9 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -333,15 +333,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -352,24 +352,24 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.cs index aa40870..5f6ff6c 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403054350_AddEmployee.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddEmployee : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.Designer.cs index aff025e..648c7f3 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210403090025_AddClassrooms")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -135,7 +135,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -173,7 +173,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -202,7 +202,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -232,7 +232,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -256,7 +256,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -285,7 +285,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -327,7 +327,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -356,9 +356,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -367,15 +367,15 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -386,9 +386,9 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -397,15 +397,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -416,26 +416,26 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.cs index 5116f39..aa14709 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403090025_AddClassrooms.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddClassrooms : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.Designer.cs index 2148356..e87c719 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210403143118_AddDisciplines")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -113,7 +113,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -148,7 +148,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -207,7 +207,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -245,7 +245,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -274,7 +274,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -304,7 +304,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -328,7 +328,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -357,7 +357,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -401,7 +401,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -430,9 +430,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -441,9 +441,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -452,15 +452,15 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -471,9 +471,9 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -482,15 +482,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -501,31 +501,31 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("UserRoles"); }); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.cs index 5c13b6f..93b6d20 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403143118_AddDisciplines.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddDisciplines : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.Designer.cs index d3e8fe3..b544385 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210403180333_AddLecturers")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -113,7 +113,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -148,7 +148,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -209,7 +209,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -247,7 +247,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -276,7 +276,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -360,7 +360,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -389,7 +389,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -418,7 +418,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -456,7 +456,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -488,7 +488,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -518,7 +518,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -542,7 +542,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -571,7 +571,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -615,7 +615,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -644,9 +644,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -655,9 +655,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -666,9 +666,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -677,15 +677,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -696,23 +696,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -727,15 +727,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany() .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany() .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -746,9 +746,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -757,15 +757,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -776,46 +776,46 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.cs index 764fbae..d173736 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210403180333_AddLecturers.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddLecturers : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs index 46203b5..bf4a171 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210404053131_AddLecturerAcademicDegreeDiscription")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -113,7 +113,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -148,7 +148,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -209,7 +209,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -247,7 +247,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -276,7 +276,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -360,7 +360,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -392,7 +392,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -421,7 +421,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -459,7 +459,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -491,7 +491,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -521,7 +521,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -545,7 +545,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -574,7 +574,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -618,7 +618,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -647,9 +647,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -658,9 +658,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -669,9 +669,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -680,15 +680,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -699,23 +699,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -730,15 +730,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany() .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany() .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -749,9 +749,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -760,15 +760,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -779,46 +779,46 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs index 894a834..1403755 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404053131_AddLecturerAcademicDegreeDiscription.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddLecturerAcademicDegreeDiscription : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.Designer.cs index 61ae776..0dd5fca 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210404065039_AddDiciplineDescription")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -279,7 +279,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -363,7 +363,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -395,7 +395,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -424,7 +424,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -462,7 +462,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -524,7 +524,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -548,7 +548,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -577,7 +577,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -621,7 +621,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -650,9 +650,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -661,9 +661,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -672,9 +672,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -683,15 +683,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -702,23 +702,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -733,15 +733,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany() .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany() .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -752,9 +752,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -763,15 +763,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -782,46 +782,46 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.cs index b1b350e..78cd851 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404065039_AddDiciplineDescription.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddDiciplineDescription : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.Designer.cs index 11d3cc2..a18dc6e 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210404070556_AddLecturer")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -279,7 +279,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -366,7 +366,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -398,7 +398,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -427,7 +427,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -465,7 +465,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -497,7 +497,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -527,7 +527,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -551,7 +551,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -580,7 +580,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -624,7 +624,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -653,9 +653,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -664,9 +664,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -675,9 +675,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -686,15 +686,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -705,23 +705,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -736,15 +736,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany() .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany() .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -755,9 +755,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -766,15 +766,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -785,46 +785,46 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.cs index fdbcbf1..588148d 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070556_AddLecturer.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddLecturer : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs index dd6a0f3..51e79cf 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210404070734_AddLecturerOnlyForPrivate")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -279,7 +279,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -369,7 +369,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -401,7 +401,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -430,7 +430,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -468,7 +468,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -500,7 +500,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -530,7 +530,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -554,7 +554,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -583,7 +583,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -627,7 +627,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -656,9 +656,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -667,9 +667,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -678,9 +678,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -689,15 +689,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -708,23 +708,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -739,15 +739,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany() .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany() .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -758,9 +758,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -769,15 +769,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -788,46 +788,46 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs index 3fa78f4..5995dc4 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404070734_AddLecturerOnlyForPrivate.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddLecturerOnlyForPrivate : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.Designer.cs index d78bf63..ffd3087 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210404170518_RemLecturerField")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -279,7 +279,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -366,7 +366,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -398,7 +398,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -427,7 +427,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -465,7 +465,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -497,7 +497,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -527,7 +527,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -551,7 +551,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -580,7 +580,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -624,7 +624,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -653,9 +653,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -664,9 +664,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -675,9 +675,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -686,15 +686,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -705,23 +705,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -736,15 +736,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("LecturerEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerEmployeePosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -755,9 +755,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -766,15 +766,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -785,53 +785,53 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); b.Navigation("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.cs index 7cccdd2..dbdea3f 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210404170518_RemLecturerField.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class RemLecturerField : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs index 4fa0c15..a93d38c 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405060128_AddEnviromentSettingsFields")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -279,7 +279,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -366,7 +366,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -398,7 +398,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -427,7 +427,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -465,7 +465,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -497,7 +497,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -527,7 +527,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -560,7 +560,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -589,7 +589,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -633,7 +633,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -662,9 +662,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -673,9 +673,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -684,9 +684,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -695,15 +695,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeeEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeeEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("EmployeeEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) @@ -714,23 +714,23 @@ namespace DatabaseCore.Migrations b.Navigation("EmployeePost"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Department.LecturerPost", "LecturerPost") + b.HasOne("CoreDatabase.Models.Department.LecturerPost", "LecturerPost") .WithMany("Lecturers") .HasForeignKey("LecturerPostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -745,15 +745,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerEmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerEmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.EmployeePost", "EmployeePost") + b.HasOne("CoreDatabase.Models.Department.EmployeePost", "EmployeePost") .WithMany("LecturerEmployeePosts") .HasForeignKey("EmployeePostId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerEmployeePosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -764,9 +764,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -775,15 +775,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -794,53 +794,53 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeeEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Navigation("EmployeeEmployeePosts"); b.Navigation("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("LecturerEmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.cs index 8feb278..dcb5929 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405060128_AddEnviromentSettingsFields.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddEnviromentSettingsFields : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.Designer.cs index dd68b65..70b1619 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405080239_RemLecturerPost")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -335,7 +335,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -367,7 +367,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -396,7 +396,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -434,7 +434,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -466,7 +466,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -496,7 +496,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -529,7 +529,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -558,7 +558,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -602,7 +602,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -631,9 +631,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -642,9 +642,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -653,9 +653,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -664,15 +664,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -683,17 +683,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -706,15 +706,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -725,9 +725,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -736,15 +736,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -755,48 +755,48 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.cs index 236e0db..16b501d 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405080239_RemLecturerPost.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class RemLecturerPost : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.Designer.cs index 5ed3126..fb1294b 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405082110_AddFieldToLecturer")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -338,7 +338,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -370,7 +370,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -399,7 +399,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -437,7 +437,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -469,7 +469,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -499,7 +499,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -532,7 +532,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -561,7 +561,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -605,7 +605,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -634,9 +634,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -645,9 +645,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -656,9 +656,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -667,15 +667,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -686,17 +686,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -709,15 +709,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -728,9 +728,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -739,15 +739,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -758,48 +758,48 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.cs index eaa2054..cba5bfb 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082110_AddFieldToLecturer.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddFieldToLecturer : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.Designer.cs index 25b67b3..e3be792 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405082213_RemFieldToLecturer")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -212,7 +212,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -250,7 +250,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -332,7 +332,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -364,7 +364,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -393,7 +393,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -431,7 +431,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -463,7 +463,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -493,7 +493,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -599,7 +599,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -628,9 +628,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -639,9 +639,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -650,9 +650,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -661,15 +661,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -680,17 +680,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -703,15 +703,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -722,9 +722,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -733,15 +733,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -752,48 +752,48 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.cs index 2b1c451..4dd64c7 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405082213_RemFieldToLecturer.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class RemFieldToLecturer : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.Designer.cs index c0ad68a..3785c7e 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405091403_AddEducationDirection")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -201,7 +201,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -262,7 +262,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -300,7 +300,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -382,7 +382,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -414,7 +414,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -443,7 +443,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -481,7 +481,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -513,7 +513,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -543,7 +543,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -576,7 +576,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -605,7 +605,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -649,7 +649,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -678,9 +678,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -689,9 +689,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -700,9 +700,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -711,9 +711,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -722,15 +722,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -741,17 +741,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -764,15 +764,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -783,9 +783,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -794,15 +794,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -813,50 +813,50 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.cs index 9be8a1e..8422599 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405091403_AddEducationDirection.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddEducationDirection : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs index d2bf8c4..d5da9f5 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405095913_UPdFieldEducationDirection")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -76,7 +76,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -116,7 +116,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -151,7 +151,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -200,7 +200,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -261,7 +261,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -299,7 +299,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -381,7 +381,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -413,7 +413,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -442,7 +442,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -480,7 +480,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -512,7 +512,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -542,7 +542,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -575,7 +575,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -604,7 +604,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -648,7 +648,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -677,9 +677,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -688,9 +688,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -699,9 +699,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -710,9 +710,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -721,15 +721,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -740,17 +740,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -763,15 +763,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -782,9 +782,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -793,15 +793,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -812,50 +812,50 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.cs index 351646c..5fcd215 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405095913_UPdFieldEducationDirection.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UPdFieldEducationDirection : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs index 271e464..f46d6b2 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210405171658_AddAcademicPlans")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -52,7 +52,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -100,7 +100,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -133,7 +133,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -188,7 +188,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -228,7 +228,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -263,7 +263,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -312,7 +312,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -373,7 +373,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -411,7 +411,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -493,7 +493,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -525,7 +525,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -554,7 +554,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -592,7 +592,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -624,7 +624,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -687,7 +687,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -717,7 +717,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -750,7 +750,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -779,7 +779,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -823,7 +823,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -852,9 +852,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) @@ -863,15 +863,15 @@ namespace DatabaseCore.Migrations b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -882,15 +882,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -901,9 +901,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -912,9 +912,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -923,9 +923,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -934,9 +934,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -945,15 +945,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -964,17 +964,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -987,15 +987,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1006,9 +1006,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1017,9 +1017,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1028,15 +1028,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1047,77 +1047,77 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs index c7352a3..c72df1a 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddAcademicPlans : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs index 0e97935..9ed7d6a 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210406063922_UpdUniqueTimeNorm")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -52,7 +52,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -100,7 +100,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -133,7 +133,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -188,7 +188,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -228,7 +228,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -263,7 +263,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -312,7 +312,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -373,7 +373,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -411,7 +411,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -493,7 +493,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -525,7 +525,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -554,7 +554,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -592,7 +592,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -624,7 +624,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -687,7 +687,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -717,7 +717,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -750,7 +750,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -779,7 +779,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -823,7 +823,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -852,9 +852,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) @@ -863,15 +863,15 @@ namespace DatabaseCore.Migrations b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -882,15 +882,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -901,9 +901,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -912,9 +912,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -923,9 +923,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -934,9 +934,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -945,15 +945,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -964,17 +964,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -987,15 +987,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1006,9 +1006,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1017,9 +1017,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1028,15 +1028,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1047,77 +1047,77 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs index 2a12c3b..5667df9 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UpdUniqueTimeNorm : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs index 656cad2..937cd72 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210406064319_ChangeTypeInacademicPlan")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -52,7 +52,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -100,7 +100,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -133,7 +133,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -188,7 +188,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -228,7 +228,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -263,7 +263,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -312,7 +312,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -373,7 +373,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -411,7 +411,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -493,7 +493,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -525,7 +525,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -554,7 +554,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -592,7 +592,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -624,7 +624,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -687,7 +687,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -717,7 +717,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -750,7 +750,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -779,7 +779,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -823,7 +823,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -852,9 +852,9 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) @@ -863,15 +863,15 @@ namespace DatabaseCore.Migrations b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -882,15 +882,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -901,9 +901,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -912,9 +912,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -923,9 +923,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -934,9 +934,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -945,15 +945,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -964,17 +964,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -987,15 +987,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1006,9 +1006,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1017,9 +1017,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1028,15 +1028,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1047,77 +1047,77 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs index da23bdf..f19d001 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class ChangeTypeInacademicPlan : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.Designer.cs index 845ddc1..121ed59 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210408152438_ChangeAcademPlan")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -688,7 +688,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -718,7 +718,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -751,7 +751,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -780,7 +780,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -824,7 +824,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -853,24 +853,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -881,15 +881,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -900,9 +900,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -911,9 +911,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -922,9 +922,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -933,9 +933,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -944,15 +944,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -963,17 +963,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -986,15 +986,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1005,9 +1005,9 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1016,9 +1016,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1027,15 +1027,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1046,77 +1046,77 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.cs index 5ef1994..f90c94b 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210408152438_ChangeAcademPlan.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class ChangeAcademPlan : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs index c274f1d..07ba8bb 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210412051258_AddStudentGroups")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -661,7 +661,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -724,7 +724,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -754,7 +754,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -787,7 +787,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -816,7 +816,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -860,7 +860,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -889,24 +889,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -917,15 +917,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -936,9 +936,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -947,9 +947,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -958,9 +958,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -969,9 +969,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -980,15 +980,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -999,17 +999,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1022,15 +1022,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1041,15 +1041,15 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("StudentGroups") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1058,9 +1058,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1069,9 +1069,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1080,15 +1080,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1099,43 +1099,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1144,36 +1144,36 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs index e873850..2b909c1 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddStudentGroups : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.Designer.cs index d3029bc..e523bae 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210412101248_AddStudents")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -688,7 +688,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -724,7 +724,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -787,7 +787,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -817,7 +817,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -850,7 +850,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -879,7 +879,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -923,7 +923,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -952,24 +952,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -980,15 +980,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.Cascade) @@ -999,9 +999,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1010,9 +1010,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1021,9 +1021,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1032,9 +1032,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1043,15 +1043,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1062,17 +1062,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1085,15 +1085,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1104,15 +1104,15 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1123,15 +1123,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("StudentGroups") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1140,9 +1140,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1151,9 +1151,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1162,15 +1162,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1181,43 +1181,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1226,41 +1226,41 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.cs index 0cf65d9..9996ca7 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412101248_AddStudents.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddStudents : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.Designer.cs index 0336db2..112d4d4 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210413070716_AddOrders")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -766,7 +766,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -802,7 +802,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -865,7 +865,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -895,7 +895,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -928,7 +928,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -957,7 +957,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1001,7 +1001,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1030,24 +1030,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1058,15 +1058,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1077,9 +1077,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1088,9 +1088,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1099,9 +1099,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1110,9 +1110,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1121,15 +1121,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1140,17 +1140,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1163,15 +1163,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1182,25 +1182,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) @@ -1215,15 +1215,15 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1234,15 +1234,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("StudentGroups") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1251,9 +1251,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1262,9 +1262,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1273,15 +1273,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1292,43 +1292,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1337,34 +1337,34 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1373,19 +1373,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.cs index 6b21740..363cffb 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210413070716_AddOrders.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddOrders : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs index d3e07ad..52091b7 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210417172126_AddOrderSyncHistories")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -684,7 +684,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -735,7 +735,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -798,7 +798,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -834,7 +834,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -897,7 +897,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -927,7 +927,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -960,7 +960,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -989,7 +989,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1033,7 +1033,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1062,24 +1062,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1090,15 +1090,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1109,9 +1109,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1120,9 +1120,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1131,9 +1131,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1142,9 +1142,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1153,15 +1153,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1172,17 +1172,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1195,15 +1195,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1214,25 +1214,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1247,9 +1247,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1258,15 +1258,15 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1277,15 +1277,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("StudentGroups") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1294,9 +1294,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1305,9 +1305,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1316,15 +1316,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1335,43 +1335,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1380,39 +1380,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1421,19 +1421,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.cs index d0241c1..5a3463c 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210417172126_AddOrderSyncHistories.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class AddOrderSyncHistories : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.Designer.cs index 830e198..4230bfc 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210427134459_ChangeStudentGroups")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.5") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -684,7 +684,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -735,7 +735,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -799,7 +799,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -835,7 +835,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -898,7 +898,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -928,7 +928,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -961,7 +961,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -990,7 +990,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1034,7 +1034,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1063,24 +1063,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1091,15 +1091,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1110,9 +1110,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1121,9 +1121,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1132,9 +1132,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1143,9 +1143,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1154,15 +1154,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1173,17 +1173,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1196,15 +1196,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1215,25 +1215,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1248,9 +1248,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1259,15 +1259,15 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1278,15 +1278,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("StudentGroups") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1295,9 +1295,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1306,9 +1306,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1317,15 +1317,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1336,43 +1336,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1381,39 +1381,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1422,19 +1422,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.cs index 4cb3857..2e2d7df 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210427134459_ChangeStudentGroups.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class ChangeStudentGroups : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.Designer.cs index 6b51196..3e1644c 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210428150932_UpdateStudnet")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.5") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -684,7 +684,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -735,7 +735,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -803,7 +803,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -839,7 +839,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -902,7 +902,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -932,7 +932,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -965,7 +965,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -994,7 +994,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1038,7 +1038,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1067,24 +1067,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1095,15 +1095,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1114,9 +1114,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1125,9 +1125,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1136,9 +1136,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1147,9 +1147,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1158,15 +1158,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1177,17 +1177,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1200,15 +1200,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1219,25 +1219,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1252,9 +1252,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1263,15 +1263,15 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1282,15 +1282,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("StudentGroups") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1299,9 +1299,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1310,9 +1310,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1321,15 +1321,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1340,43 +1340,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1385,39 +1385,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1426,19 +1426,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.cs index cae74a0..5767354 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210428150932_UpdateStudnet.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UpdateStudnet : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.Designer.cs index 25f986c..4ab9cf3 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210430050931_UpdateStudnet2")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.5") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -684,7 +684,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -735,7 +735,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -802,7 +802,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -838,7 +838,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -901,7 +901,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -931,7 +931,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -964,7 +964,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -993,7 +993,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1037,7 +1037,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1066,24 +1066,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1094,15 +1094,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1113,9 +1113,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1124,9 +1124,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1135,9 +1135,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1146,9 +1146,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1157,15 +1157,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1176,17 +1176,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1199,15 +1199,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1218,25 +1218,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1251,9 +1251,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1262,15 +1262,15 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1281,15 +1281,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("StudentGroups") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1298,9 +1298,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1309,9 +1309,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1320,15 +1320,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1339,43 +1339,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1384,39 +1384,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1425,19 +1425,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.cs index 40f778f..447e6ae 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430050931_UpdateStudnet2.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UpdateStudnet2 : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.Designer.cs index 72bab8a..b6b7701 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.Designer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.Designer.cs @@ -1,13 +1,13 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20210430051530_UpdateStudnet3")] @@ -21,7 +21,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.5") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -53,7 +53,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -101,7 +101,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -134,7 +134,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -189,7 +189,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -229,7 +229,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -264,7 +264,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -313,7 +313,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -374,7 +374,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -412,7 +412,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -494,7 +494,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -526,7 +526,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -555,7 +555,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -593,7 +593,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -625,7 +625,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -671,7 +671,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -684,7 +684,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -703,7 +703,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -735,7 +735,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -801,7 +801,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -837,7 +837,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -900,7 +900,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -930,7 +930,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -963,7 +963,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -992,7 +992,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1036,7 +1036,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1065,24 +1065,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1093,15 +1093,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1112,9 +1112,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1123,9 +1123,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1134,9 +1134,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1145,9 +1145,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1156,15 +1156,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1175,17 +1175,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1198,15 +1198,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1217,25 +1217,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1250,9 +1250,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1261,13 +1261,13 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1278,15 +1278,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("StudentGroups") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1295,9 +1295,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1306,9 +1306,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1317,15 +1317,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1336,43 +1336,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1381,39 +1381,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1422,19 +1422,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.cs index 61e6bfd..95c2d47 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210430051530_UpdateStudnet3.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { public partial class UpdateStudnet3 : Migration { diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs index 2cd219c..44ba888 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs @@ -1,12 +1,12 @@ // using System; -using DatabaseCore; +using CoreDatabase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace DatabaseCore.Migrations +namespace CoreDatabase.Migrations { [DbContext(typeof(DatabaseContext))] partial class DatabaseContextModelSnapshot : ModelSnapshot @@ -19,7 +19,7 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.5") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -51,7 +51,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlans"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -99,7 +99,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -132,7 +132,7 @@ namespace DatabaseCore.Migrations b.ToTable("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -187,7 +187,7 @@ namespace DatabaseCore.Migrations b.ToTable("Classrooms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -227,7 +227,7 @@ namespace DatabaseCore.Migrations b.ToTable("Disciplines"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -262,7 +262,7 @@ namespace DatabaseCore.Migrations b.ToTable("DisciplineBlocks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -311,7 +311,7 @@ namespace DatabaseCore.Migrations b.ToTable("EducationDirections"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -372,7 +372,7 @@ namespace DatabaseCore.Migrations b.ToTable("Employees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -410,7 +410,7 @@ namespace DatabaseCore.Migrations b.ToTable("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -492,7 +492,7 @@ namespace DatabaseCore.Migrations b.ToTable("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -524,7 +524,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicDegrees"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -553,7 +553,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerAcademicRanks"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -591,7 +591,7 @@ namespace DatabaseCore.Migrations b.ToTable("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -623,7 +623,7 @@ namespace DatabaseCore.Migrations b.ToTable("Orders"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -669,7 +669,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -682,7 +682,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistories"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -701,7 +701,7 @@ namespace DatabaseCore.Migrations b.ToTable("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -733,7 +733,7 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -799,7 +799,7 @@ namespace DatabaseCore.Migrations b.ToTable("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -835,7 +835,7 @@ namespace DatabaseCore.Migrations b.ToTable("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -898,7 +898,7 @@ namespace DatabaseCore.Migrations b.ToTable("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -928,7 +928,7 @@ namespace DatabaseCore.Migrations b.ToTable("Accesses"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + modelBuilder.Entity("CoreDatabase.Models.Security.EnviromentSetting", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -961,7 +961,7 @@ namespace DatabaseCore.Migrations b.ToTable("EnviromentSettings"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -990,7 +990,7 @@ namespace DatabaseCore.Migrations b.ToTable("Roles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1034,7 +1034,7 @@ namespace DatabaseCore.Migrations b.ToTable("Users"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { b.Property("Id") .HasColumnType("uniqueidentifier"); @@ -1063,24 +1063,24 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("AcademicPlans") .HasForeignKey("EducationDirectionId"); b.Navigation("EducationDirection"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + b.HasOne("CoreDatabase.Models.Department.AcademicPlan", "AcademicPlan") .WithMany("AcademicPlanRecords") .HasForeignKey("AcademicPlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + b.HasOne("CoreDatabase.Models.Department.Discipline", "Discipline") .WithMany("AcademicPlanRecords") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) @@ -1091,15 +1091,15 @@ namespace DatabaseCore.Migrations b.Navigation("Discipline"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecordTimeNormHour", b => { - b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + b.HasOne("CoreDatabase.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("AcademicPlanRecordId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + b.HasOne("CoreDatabase.Models.Department.TimeNorm", "TimeNorm") .WithMany("AcademicPlanRecordTimeNormHours") .HasForeignKey("TimeNormId") .OnDelete(DeleteBehavior.NoAction) @@ -1110,9 +1110,9 @@ namespace DatabaseCore.Migrations b.Navigation("TimeNorm"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Classroom", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("Classrooms") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) @@ -1121,9 +1121,9 @@ namespace DatabaseCore.Migrations b.Navigation("Employee"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("Disciplines") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1132,9 +1132,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("EducationDirections") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) @@ -1143,9 +1143,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Employees") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1154,15 +1154,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EmployeePost", b => { - b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + b.HasOne("CoreDatabase.Models.Department.Employee", "Employee") .WithMany("EmployeePosts") .HasForeignKey("EmployeeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("EmployeePosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1173,17 +1173,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicDegreeId"); - b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + b.HasOne("CoreDatabase.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") .WithMany("Lecturers") .HasForeignKey("LecturerAcademicRankId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Lecturers") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1196,15 +1196,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerPost", b => { - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("LecturerPosts") .HasForeignKey("LecturerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Post", "Post") + b.HasOne("CoreDatabase.Models.Department.Post", "Post") .WithMany("LecturerPosts") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Cascade) @@ -1215,25 +1215,25 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderStudentRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderStudentRecord", b => { - b.HasOne("DatabaseCore.Models.Department.Order", "Order") + b.HasOne("CoreDatabase.Models.Department.Order", "Order") .WithMany("OrderStudentRecords") .HasForeignKey("OrderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupFrom") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupFrom") .WithMany("OrderStudentRecordFroms") .HasForeignKey("StudentGroupFromId") .OnDelete(DeleteBehavior.SetNull); - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroupTo") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroupTo") .WithMany("OrderStudentRecordTos") .HasForeignKey("StudentGroupToId") .OnDelete(DeleteBehavior.NoAction); - b.HasOne("DatabaseCore.Models.Department.Student", "Student") + b.HasOne("CoreDatabase.Models.Department.Student", "Student") .WithMany("OrderStudentRecords") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.NoAction) @@ -1248,9 +1248,9 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroupTo"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistoryRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistoryRecord", b => { - b.HasOne("DatabaseCore.Models.Department.OrderSyncHistory", "OrderSyncHistory") + b.HasOne("CoreDatabase.Models.Department.OrderSyncHistory", "OrderSyncHistory") .WithMany("OrderSyncHistoryRecords") .HasForeignKey("OrderSyncHistoryId") .OnDelete(DeleteBehavior.Cascade) @@ -1259,13 +1259,13 @@ namespace DatabaseCore.Migrations b.Navigation("OrderSyncHistory"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { - b.HasOne("DatabaseCore.Models.Department.StudentGroup", "StudentGroup") + b.HasOne("CoreDatabase.Models.Department.StudentGroup", "StudentGroup") .WithMany("Students") .HasForeignKey("StudentGroupId"); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("Students") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1276,15 +1276,15 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { - b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + b.HasOne("CoreDatabase.Models.Department.EducationDirection", "EducationDirection") .WithMany("StudentGroups") .HasForeignKey("EducationDirectionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + b.HasOne("CoreDatabase.Models.Department.Lecturer", "Lecturer") .WithMany("StudentGroups") .HasForeignKey("LecturerId"); @@ -1293,9 +1293,9 @@ namespace DatabaseCore.Migrations b.Navigation("Lecturer"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { - b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") .WithMany("TimeNorms") .HasForeignKey("DisciplineBlockId") .OnDelete(DeleteBehavior.Cascade) @@ -1304,9 +1304,9 @@ namespace DatabaseCore.Migrations b.Navigation("DisciplineBlock"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Access", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("Access") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) @@ -1315,15 +1315,15 @@ namespace DatabaseCore.Migrations b.Navigation("Role"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + modelBuilder.Entity("CoreDatabase.Models.Security.UserRole", b => { - b.HasOne("DatabaseCore.Models.Security.Role", "Role") + b.HasOne("CoreDatabase.Models.Security.Role", "Role") .WithMany("UserRoles") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("DatabaseCore.Models.Security.User", "User") + b.HasOne("CoreDatabase.Models.Security.User", "User") .WithMany("UserRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) @@ -1334,43 +1334,43 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + modelBuilder.Entity("CoreDatabase.Models.Department.AcademicPlanRecord", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Discipline", b => { b.Navigation("AcademicPlanRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + modelBuilder.Entity("CoreDatabase.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); b.Navigation("TimeNorms"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + modelBuilder.Entity("CoreDatabase.Models.Department.EducationDirection", b => { b.Navigation("AcademicPlans"); b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Employee", b => { b.Navigation("Classrooms"); b.Navigation("EmployeePosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Lecturer", b => { b.Navigation("EducationDirections"); @@ -1379,39 +1379,39 @@ namespace DatabaseCore.Migrations b.Navigation("StudentGroups"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicDegree", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + modelBuilder.Entity("CoreDatabase.Models.Department.LecturerAcademicRank", b => { b.Navigation("Lecturers"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Order", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Order", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.OrderSyncHistory", b => + modelBuilder.Entity("CoreDatabase.Models.Department.OrderSyncHistory", b => { b.Navigation("OrderSyncHistoryRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Post", b => { b.Navigation("EmployeePosts"); b.Navigation("LecturerPosts"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.Student", b => + modelBuilder.Entity("CoreDatabase.Models.Department.Student", b => { b.Navigation("OrderStudentRecords"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + modelBuilder.Entity("CoreDatabase.Models.Department.StudentGroup", b => { b.Navigation("OrderStudentRecordFroms"); @@ -1420,19 +1420,19 @@ namespace DatabaseCore.Migrations b.Navigation("Students"); }); - modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => { b.Navigation("AcademicPlanRecordTimeNormHours"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + modelBuilder.Entity("CoreDatabase.Models.Security.Role", b => { b.Navigation("Access"); b.Navigation("UserRoles"); }); - modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + modelBuilder.Entity("CoreDatabase.Models.Security.User", b => { b.Navigation("Employees"); diff --git a/DepartmentPortal/Common/DatabaseCore/Models/BaseEntity.cs b/DepartmentPortal/Common/DatabaseCore/Models/BaseEntity.cs index 4819b48..af885b0 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/BaseEntity.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/BaseEntity.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.Serialization; -namespace DatabaseCore.Models +namespace CoreDatabase.Models { /// /// Базовый набор для сущности diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs index aa9bec3..00d4ad4 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class AcademicPlan : BaseEntity, IEntitySecurityExtenstion, IAcademicPlanModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs index 0184b11..6831b0c 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs @@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class AcademicPlanRecord : BaseEntity, IEntitySecurityExtenstion, IAcademicPlanRecordModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs index 74d92d1..5b3b5b9 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs @@ -4,7 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class AcademicPlanRecordTimeNormHour : BaseEntity, IEntitySecurityExtenstion, IAcademicPlanRecordTimeNormHourModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs index d4c7d20..83a2209 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs @@ -5,7 +5,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Classroom : BaseEntity, IEntitySecurityExtenstion, IClassroomModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs index 9dd5a45..123d7ee 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { /// /// Класс, описывающий дисципилну кафедры diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs index 029843b..9b1711e 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class DisciplineBlock : BaseEntity, IEntitySecurityExtenstion, IDisciplineBlockModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs index d0ca853..646cbd9 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs @@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { /// /// Класс, описывающий направление обучения кафедры diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Employee.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Employee.cs index 61eb2d1..64097b5 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Employee.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Employee.cs @@ -1,5 +1,5 @@ using CoreModels.ModelsDepartment; -using DatabaseCore.Models.Security; +using CoreDatabase.Models.Security; using ToolsModule.Extensions; using ToolsModule.Interfaces; using System; @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Employee : BaseEntity, IEntitySecurityExtenstion, IEmployeeModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/EmployeePost.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/EmployeePost.cs index 8a0b458..5851a13 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/EmployeePost.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/EmployeePost.cs @@ -3,7 +3,7 @@ using ToolsModule.Interfaces; using System; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class EmployeePost : BaseEntity, IEntitySecurityExtenstion, IEmployeePostModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs index da8bf2a..1d856f8 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs @@ -1,5 +1,5 @@ using CoreModels.ModelsDepartment; -using DatabaseCore.Models.Security; +using CoreDatabase.Models.Security; using ToolsModule.Extensions; using ToolsModule.Interfaces; using System; @@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Lecturer : BaseEntity, IEntitySecurityExtenstion, ILecturerModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicDegree.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicDegree.cs index 604ca51..947e3e5 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicDegree.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicDegree.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class LecturerAcademicDegree : BaseEntity, IEntitySecurityExtenstion, ILecturerAcademicDegreeModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicRank.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicRank.cs index 5917f00..fbc52a3 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicRank.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerAcademicRank.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class LecturerAcademicRank : BaseEntity, IEntitySecurityExtenstion, ILecturerAcademicRankModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerPost.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerPost.cs index 355e5b6..8e148d6 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerPost.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/LecturerPost.cs @@ -4,7 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class LecturerPost : BaseEntity, IEntitySecurityExtenstion, ILecturerPostModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs index 51ecce1..a6a2992 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Order.cs @@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Order : BaseEntity, IEntitySecurityExtenstion, IOrderModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs index 820d3ed..e1d0997 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderStudentRecord.cs @@ -5,7 +5,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class OrderStudentRecord : BaseEntity, IEntitySecurityExtenstion, IOrderStudentRecordModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistory.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistory.cs index e0afce0..bae30c5 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistory.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistory.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class OrderSyncHistory : IdEntity, IEntitySecurityExtenstion, IOrderSyncHistoryModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistoryRecord.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistoryRecord.cs index 5317d5a..e0e0792 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistoryRecord.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/OrderSyncHistoryRecord.cs @@ -4,7 +4,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class OrderSyncHistoryRecord : IdEntity, IEntitySecurityExtenstion, IOrderSyncHistoryRecordModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Post.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Post.cs index 96e96d6..88db813 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Post.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Post.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Post : BaseEntity, IEntitySecurityExtenstion, IPostModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Student.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Student.cs index 3f99e24..7f8fd9b 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Student.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Student.cs @@ -1,6 +1,6 @@ using CoreModels.Enums.Department; using CoreModels.ModelsDepartment; -using DatabaseCore.Models.Security; +using CoreDatabase.Models.Security; using ToolsModule.Extensions; using ToolsModule.Interfaces; using System; @@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class Student : BaseEntity, IEntitySecurityExtenstion, IStudentModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs index 1ed73eb..a2df439 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs @@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class StudentGroup : BaseEntity, IEntitySecurityExtenstion, IStudentGroupModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs index f1f9f25..d49f400 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs @@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Department +namespace CoreDatabase.Models.Department { [DataContract] public class TimeNorm : BaseEntity, IEntitySecurityExtenstion, ITimeNormModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/IdEntity.cs b/DepartmentPortal/Common/DatabaseCore/Models/IdEntity.cs index ce258ba..a47753f 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/IdEntity.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/IdEntity.cs @@ -3,7 +3,7 @@ using System; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models +namespace CoreDatabase.Models { /// /// Тип Id для всеъ сущностей diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Security/Access.cs b/DepartmentPortal/Common/DatabaseCore/Models/Security/Access.cs index a6fadcc..8483ffc 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Security/Access.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Security/Access.cs @@ -5,7 +5,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Security +namespace CoreDatabase.Models.Security { [DataContract] public class Access : BaseEntity, IEntitySecurityExtenstion, IAccessModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Security/EnviromentSetting.cs b/DepartmentPortal/Common/DatabaseCore/Models/Security/EnviromentSetting.cs index bb7b20e..8b1b7c1 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Security/EnviromentSetting.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Security/EnviromentSetting.cs @@ -3,7 +3,7 @@ using ToolsModule.Interfaces; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Security +namespace CoreDatabase.Models.Security { [DataContract] public class EnviromentSetting : BaseEntity, IEntitySecurityExtenstion, IEnviromentSettingModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Security/Role.cs b/DepartmentPortal/Common/DatabaseCore/Models/Security/Role.cs index 39d6312..3dd2383 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Security/Role.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Security/Role.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Security +namespace CoreDatabase.Models.Security { [DataContract] public class Role : BaseEntity, IEntitySecurityExtenstion, IRoleModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Security/User.cs b/DepartmentPortal/Common/DatabaseCore/Models/Security/User.cs index cdfa8a2..e55008e 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Security/User.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Security/User.cs @@ -1,5 +1,5 @@ using CoreModels.ModelsSecurity; -using DatabaseCore.Models.Department; +using CoreDatabase.Models.Department; using ToolsModule.Attributes; using ToolsModule.Interfaces; using System; @@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Security +namespace CoreDatabase.Models.Security { [DataContract] public class User : BaseEntity, IEntitySecurityExtenstion, IUserModel diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Security/UserRole.cs b/DepartmentPortal/Common/DatabaseCore/Models/Security/UserRole.cs index 650786f..ab6e132 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Security/UserRole.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Security/UserRole.cs @@ -3,7 +3,7 @@ using ToolsModule.Interfaces; using System; using System.Runtime.Serialization; -namespace DatabaseCore.Models.Security +namespace CoreDatabase.Models.Security { [DataContract] public class UserRole : BaseEntity, IEntitySecurityExtenstion, IUserRoleModel diff --git a/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs b/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs index 1298083..3a51547 100644 --- a/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs +++ b/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace DatabaseCore.Scripts +namespace CoreDatabase.Scripts { /// /// Скрипты для миграции данных по кафедре diff --git a/DepartmentPortal/Common/DatabaseCore/Scripts/SecureMigrationScript.cs b/DepartmentPortal/Common/DatabaseCore/Scripts/SecureMigrationScript.cs index 2919205..52b3ac5 100644 --- a/DepartmentPortal/Common/DatabaseCore/Scripts/SecureMigrationScript.cs +++ b/DepartmentPortal/Common/DatabaseCore/Scripts/SecureMigrationScript.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace DatabaseCore.Scripts +namespace CoreDatabase.Scripts { /// /// Скрипты для миграции данных по безопасности diff --git a/DepartmentPortal/Common/DatabaseCore/SecurityManager.cs b/DepartmentPortal/Common/DatabaseCore/SecurityManager.cs index 69eff1c..0a89367 100644 --- a/DepartmentPortal/Common/DatabaseCore/SecurityManager.cs +++ b/DepartmentPortal/Common/DatabaseCore/SecurityManager.cs @@ -1,4 +1,4 @@ -using DatabaseCore.Models.Security; +using CoreDatabase.Models.Security; using ToolsModule.Enums; using ToolsModule.Interfaces; using ToolsModule.Models; @@ -9,7 +9,7 @@ using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; -namespace DatabaseCore +namespace CoreDatabase { public class SecurityManager : ISecurityManager { diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentDatabaseImplementation.csproj b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentDatabaseImplementation.csproj index 3c7192e..1d71d7c 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentDatabaseImplementation.csproj +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentDatabaseImplementation.csproj @@ -1,11 +1,11 @@ - + net5.0 - + diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs index 2319afe..94af3d6 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs index 7c141b0..254781a 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs index f3ee1a9..e2853c4 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs @@ -1,6 +1,6 @@ using CoreModels.Enums.Department; -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/ClassroomService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/ClassroomService.cs index adc02bd..33efeff 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/ClassroomService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/ClassroomService.cs @@ -1,6 +1,6 @@ using CoreModels.Enums.Department; -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs index 4c5b2f2..16c05e2 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs index 62617b2..bd43231 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs index 9ecf894..b8106d7 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs index 5fc89b4..2080fe1 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs index cf9e7ba..09ebea3 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicDegreeService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicDegreeService.cs index 0a59a1f..f4ed093 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicDegreeService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicDegreeService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicRankService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicRankService.cs index 71824f2..26546f4 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicRankService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerAcademicRankService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerPostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerPostService.cs index 7373d07..86dc5bb 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerPostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerPostService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs index 128a4ab..c463659 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderService.cs index 526d740..b41e0e6 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs index e3fc671..33977f3 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderStudentRecordService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryRecordService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryRecordService.cs index f2774ad..7663495 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryRecordService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryRecordService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryService.cs index a14347a..ea5d953 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/OrderSyncHistoryService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs index d8db7ae..5b36a3e 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs index 69c5c82..6349eaa 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentService.cs index a169f16..c17b6db 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs index 0b747a6..0868324 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; +using CoreDatabase; +using CoreDatabase.Models.Department; using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Models/ParsPlxModel.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Models/ParsPlxModel.cs index 27a827d..8af275d 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Models/ParsPlxModel.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Models/ParsPlxModel.cs @@ -1,5 +1,5 @@ using CoreModels.Enums.Department; -using DatabaseCore.Models.Department; +using CoreDatabase.Models.Department; using System; using System.Collections.Generic; using System.Xml; diff --git a/DepartmentPortal/DepartmentPortal.sln b/DepartmentPortal/DepartmentPortal.sln index 4dd8fff..623b4fa 100644 --- a/DepartmentPortal/DepartmentPortal.sln +++ b/DepartmentPortal/DepartmentPortal.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.31112.23 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{6F154F8D-3437-45EE-9D89-02B96BDF3E8E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseCore", "Common\DatabaseCore\DatabaseCore.csproj", "{D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{7DA26C36-778E-4563-9AEC-966E26EA7B2A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecurityBusinessLogic", "Security\SecurityBusinessLogic\SecurityBusinessLogic.csproj", "{D424B54F-AF26-4A39-8D2B-CF874F31DE42}" @@ -31,16 +29,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolsModule", "Common\Tools EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolsDesktop", "Common\ToolsDesktop\ToolsDesktop.csproj", "{FF2FD244-613D-4BE7-A6D6-6B71A45C662E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreDatabase", "Common\CoreDatabase\CoreDatabase.csproj", "{C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A}.Release|Any CPU.Build.0 = Release|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Debug|Any CPU.Build.0 = Debug|Any CPU {D424B54F-AF26-4A39-8D2B-CF874F31DE42}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -81,12 +77,15 @@ Global {FF2FD244-613D-4BE7-A6D6-6B71A45C662E}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF2FD244-613D-4BE7-A6D6-6B71A45C662E}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF2FD244-613D-4BE7-A6D6-6B71A45C662E}.Release|Any CPU.Build.0 = Release|Any CPU + {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {D4DAAEDE-A550-42BB-A50C-AD8FCB23D00A} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {D424B54F-AF26-4A39-8D2B-CF874F31DE42} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {40F7C37A-3544-4A6A-893D-D611DE100036} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} {26FCAAC6-F8F4-4CE6-92FE-1C6C376E5DE6} = {7DA26C36-778E-4563-9AEC-966E26EA7B2A} @@ -96,6 +95,7 @@ Global {FDF81413-ABAD-4890-A60F-4FEC62DD2A7D} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {26F68044-DA58-4E85-ACD7-FCC0B52B422B} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {FF2FD244-613D-4BE7-A6D6-6B71A45C662E} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} + {C2AADB97-4122-48AB-9E48-6C2A9C33BFE4} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9} diff --git a/DepartmentPortal/DepartmentPortalDesctop/DepartmentPortalDesctop.csproj b/DepartmentPortal/DepartmentPortalDesctop/DepartmentPortalDesctop.csproj index 4be6966..c50a8fc 100644 --- a/DepartmentPortal/DepartmentPortalDesctop/DepartmentPortalDesctop.csproj +++ b/DepartmentPortal/DepartmentPortalDesctop/DepartmentPortalDesctop.csproj @@ -14,7 +14,7 @@ - + diff --git a/DepartmentPortal/DepartmentPortalDesctop/Program.cs b/DepartmentPortal/DepartmentPortalDesctop/Program.cs index a41665d..23f28a1 100644 --- a/DepartmentPortal/DepartmentPortalDesctop/Program.cs +++ b/DepartmentPortal/DepartmentPortalDesctop/Program.cs @@ -1,4 +1,4 @@ -using DatabaseCore; +using CoreDatabase; using ToolsModule.BusinessLogics; using ToolsModule.Interfaces; using System; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/AccessService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/AccessService.cs index 14b36d3..10988d9 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/AccessService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/AccessService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Security; +using CoreDatabase; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; using ToolsModule.Models; using SecurityBusinessLogic.BindingModels; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/BackupJsonContractService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/BackupJsonContractService.cs index 65236fe..7b027d8 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/BackupJsonContractService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/BackupJsonContractService.cs @@ -1,4 +1,4 @@ -using DatabaseCore; +using CoreDatabase; using ToolsModule.Attributes; using ToolsModule.Extensions; using ToolsModule.Interfaces; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/EnviromentSettingService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/EnviromentSettingService.cs index fda1ae8..9cecfb4 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/EnviromentSettingService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/EnviromentSettingService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Security; +using CoreDatabase; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; using ToolsModule.Extensions; using ToolsModule.Models; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/RoleService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/RoleService.cs index 8cb32b7..735965d 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/RoleService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/RoleService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Security; +using CoreDatabase; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; using ToolsModule.Enums; using ToolsModule.Extensions; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserRoleService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserRoleService.cs index 4dffe65..00fb718 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserRoleService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserRoleService.cs @@ -1,5 +1,5 @@ -using DatabaseCore; -using DatabaseCore.Models.Security; +using CoreDatabase; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; using ToolsModule.Models; using SecurityBusinessLogic.BindingModels; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs index 734104f..d577c61 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs @@ -1,6 +1,6 @@ -using DatabaseCore; -using DatabaseCore.Models.Department; -using DatabaseCore.Models.Security; +using CoreDatabase; +using CoreDatabase.Models.Department; +using CoreDatabase.Models.Security; using Microsoft.EntityFrameworkCore; using ToolsModule.Enums; using ToolsModule.Extensions; diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/SecurityDatabaseImplementation.csproj b/DepartmentPortal/Security/SecurityDatabaseImplementation/SecurityDatabaseImplementation.csproj index 4f6a068..30d198b 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/SecurityDatabaseImplementation.csproj +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/SecurityDatabaseImplementation.csproj @@ -1,11 +1,11 @@ - + net5.0 - +