TestDataBaseCheskinaContext.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.EntityFrameworkCore;
  4. namespace AvaloniaApplication4.Models;
  5. public partial class TestDataBaseCheskinaContext : DbContext
  6. {
  7. public TestDataBaseCheskinaContext()
  8. {
  9. }
  10. public TestDataBaseCheskinaContext(DbContextOptions<TestDataBaseCheskinaContext> options)
  11. : base(options)
  12. {
  13. }
  14. public virtual DbSet<CodeAcademicSubject> CodeAcademicSubjects { get; set; }
  15. public virtual DbSet<CodeCompetency> CodeCompetencies { get; set; }
  16. public virtual DbSet<Competency> Competencies { get; set; }
  17. public virtual DbSet<Grade> Grades { get; set; }
  18. public virtual DbSet<Log> Logs { get; set; }
  19. public virtual DbSet<MdkWithModule> MdkWithModules { get; set; }
  20. public virtual DbSet<Module> Modules { get; set; }
  21. public virtual DbSet<ModulesWithCompetency> ModulesWithCompetencies { get; set; }
  22. public virtual DbSet<ProgramStatus> ProgramStatuses { get; set; }
  23. public virtual DbSet<ProgramTemplate> ProgramTemplates { get; set; }
  24. public virtual DbSet<ProgramsWithModule> ProgramsWithModules { get; set; }
  25. public virtual DbSet<ProgramsWithStudent> ProgramsWithStudents { get; set; }
  26. public virtual DbSet<ProgramsWithSubject> ProgramsWithSubjects { get; set; }
  27. public virtual DbSet<RunningProgram> RunningPrograms { get; set; }
  28. public virtual DbSet<Student> Students { get; set; }
  29. public virtual DbSet<StudentsEducation> StudentsEducations { get; set; }
  30. public virtual DbSet<StudyListModulesStudent> StudyListModulesStudents { get; set; }
  31. public virtual DbSet<StudyListSubjectsStudent> StudyListSubjectsStudents { get; set; }
  32. public virtual DbSet<Subject> Subjects { get; set; }
  33. public virtual DbSet<SystemRole> SystemRoles { get; set; }
  34. public virtual DbSet<TrainingStandart> TrainingStandarts { get; set; }
  35. public virtual DbSet<User> Users { get; set; }
  36. public virtual DbSet<UsersLogin> UsersLogins { get; set; }
  37. public virtual DbSet<UsersWithRole> UsersWithRoles { get; set; }
  38. public virtual DbSet<WaysToChange> WaysToChanges { get; set; }
  39. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  40. #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
  41. => optionsBuilder.UseNpgsql("Host=ngknn.ru;Port=5442;Database=testDataBaseCheskina;Username=41P;Password=12357");
  42. protected override void OnModelCreating(ModelBuilder modelBuilder)
  43. {
  44. modelBuilder.Entity<CodeAcademicSubject>(entity =>
  45. {
  46. entity.HasKey(e => e.IdCodeAcademicSubjects).HasName("code_academic_subjects_pk");
  47. entity.ToTable("code_academic_subjects");
  48. entity.Property(e => e.IdCodeAcademicSubjects)
  49. .HasColumnType("character varying")
  50. .HasColumnName("id_code_academic_subjects");
  51. });
  52. modelBuilder.Entity<CodeCompetency>(entity =>
  53. {
  54. entity.HasKey(e => e.Code).HasName("code_competencies_pk");
  55. entity.ToTable("code_competencies");
  56. entity.Property(e => e.Code)
  57. .HasColumnType("character varying")
  58. .HasColumnName("code");
  59. });
  60. modelBuilder.Entity<Competency>(entity =>
  61. {
  62. entity.HasKey(e => e.IdCompenetnce).HasName("competencies_pk");
  63. entity.ToTable("competencies");
  64. entity.Property(e => e.IdCompenetnce)
  65. .UseIdentityAlwaysColumn()
  66. .HasColumnName("id_compenetnce");
  67. entity.Property(e => e.CodeCompenetnce)
  68. .HasColumnType("character varying")
  69. .HasColumnName("code_compenetnce");
  70. entity.Property(e => e.Description)
  71. .HasColumnType("character varying")
  72. .HasColumnName("description");
  73. entity.Property(e => e.NameCompetence)
  74. .HasColumnType("character varying")
  75. .HasColumnName("name_competence");
  76. entity.HasOne(d => d.CodeCompenetnceNavigation).WithMany(p => p.Competencies)
  77. .HasForeignKey(d => d.CodeCompenetnce)
  78. .HasConstraintName("competencies_code_competencies_fk");
  79. });
  80. modelBuilder.Entity<Grade>(entity =>
  81. {
  82. entity.HasKey(e => e.Id).HasName("grade_pk");
  83. entity.ToTable("grade");
  84. entity.Property(e => e.Id)
  85. .UseIdentityAlwaysColumn()
  86. .HasColumnName("id");
  87. entity.Property(e => e.Name)
  88. .HasColumnType("character varying")
  89. .HasColumnName("name");
  90. });
  91. modelBuilder.Entity<Log>(entity =>
  92. {
  93. entity.HasKey(e => e.IdLog).HasName("logs_pk");
  94. entity.ToTable("logs");
  95. entity.Property(e => e.IdLog)
  96. .UseIdentityAlwaysColumn()
  97. .HasColumnName("id_log");
  98. entity.Property(e => e.Date).HasColumnName("date");
  99. entity.Property(e => e.Description)
  100. .HasColumnType("character varying")
  101. .HasColumnName("description");
  102. entity.Property(e => e.IdUser).HasColumnName("id_user");
  103. entity.HasOne(d => d.IdUserNavigation).WithMany(p => p.Logs)
  104. .HasForeignKey(d => d.IdUser)
  105. .HasConstraintName("logs_users_fk");
  106. });
  107. modelBuilder.Entity<MdkWithModule>(entity =>
  108. {
  109. entity.HasKey(e => e.Id).HasName("mdk_with_modules_pk");
  110. entity.ToTable("mdk_with_modules");
  111. entity.Property(e => e.Id)
  112. .UseIdentityAlwaysColumn()
  113. .HasColumnName("id");
  114. entity.Property(e => e.IdMdk).HasColumnName("id_mdk");
  115. entity.Property(e => e.IdModule).HasColumnName("id_module");
  116. entity.HasOne(d => d.IdMdkNavigation).WithMany(p => p.MdkWithModules)
  117. .HasForeignKey(d => d.IdMdk)
  118. .HasConstraintName("mdk_with_modules_fk_1");
  119. entity.HasOne(d => d.IdModuleNavigation).WithMany(p => p.MdkWithModules)
  120. .HasForeignKey(d => d.IdModule)
  121. .HasConstraintName("mdk_with_modules_fk");
  122. });
  123. modelBuilder.Entity<Module>(entity =>
  124. {
  125. entity.HasKey(e => e.IdModule).HasName("modules_pk");
  126. entity.ToTable("modules");
  127. entity.HasIndex(e => e.CodeModule, "modules_un").IsUnique();
  128. entity.Property(e => e.IdModule)
  129. .UseIdentityAlwaysColumn()
  130. .HasColumnName("id_module");
  131. entity.Property(e => e.CodeModule)
  132. .HasColumnType("character varying")
  133. .HasColumnName("code_module");
  134. entity.Property(e => e.IdTrainingStandarts).HasColumnName("id_training_standarts");
  135. entity.Property(e => e.Name)
  136. .HasColumnType("character varying")
  137. .HasColumnName("name");
  138. entity.HasOne(d => d.IdTrainingStandartsNavigation).WithMany(p => p.Modules)
  139. .HasForeignKey(d => d.IdTrainingStandarts)
  140. .HasConstraintName("modules_training_standarts_fk");
  141. });
  142. modelBuilder.Entity<ModulesWithCompetency>(entity =>
  143. {
  144. entity.HasKey(e => e.Id).HasName("modules_with_competencies_pk");
  145. entity.ToTable("modules_with_competencies");
  146. entity.Property(e => e.Id)
  147. .UseIdentityAlwaysColumn()
  148. .HasColumnName("id");
  149. entity.Property(e => e.IdCompetence).HasColumnName("id_competence");
  150. entity.Property(e => e.IdModule).HasColumnName("id_module");
  151. entity.HasOne(d => d.IdCompetenceNavigation).WithMany(p => p.ModulesWithCompetencies)
  152. .HasForeignKey(d => d.IdCompetence)
  153. .HasConstraintName("modules_with_competencies_competencies_fk");
  154. entity.HasOne(d => d.IdModuleNavigation).WithMany(p => p.ModulesWithCompetencies)
  155. .HasForeignKey(d => d.IdModule)
  156. .HasConstraintName("modules_with_competencies_modules_fk");
  157. });
  158. modelBuilder.Entity<ProgramStatus>(entity =>
  159. {
  160. entity.HasKey(e => e.IdStatus).HasName("program_status_pk");
  161. entity.ToTable("program_status");
  162. entity.Property(e => e.IdStatus)
  163. .UseIdentityAlwaysColumn()
  164. .HasColumnName("id_status");
  165. entity.Property(e => e.NameStatus)
  166. .HasColumnType("character varying")
  167. .HasColumnName("name_status");
  168. });
  169. modelBuilder.Entity<ProgramTemplate>(entity =>
  170. {
  171. entity.HasKey(e => e.IdProgramTemplate).HasName("program_template_pk");
  172. entity.ToTable("program_template");
  173. entity.HasIndex(e => e.CodeProgram, "program_template_un").IsUnique();
  174. entity.Property(e => e.IdProgramTemplate)
  175. .UseIdentityAlwaysColumn()
  176. .HasColumnName("id_program_template");
  177. entity.Property(e => e.CodeProgram)
  178. .HasColumnType("character varying")
  179. .HasColumnName("code_program");
  180. entity.Property(e => e.NameProgram)
  181. .HasColumnType("character varying")
  182. .HasColumnName("name_program");
  183. });
  184. modelBuilder.Entity<ProgramsWithModule>(entity =>
  185. {
  186. entity.HasKey(e => e.Id).HasName("programs_with_modules_pk");
  187. entity.ToTable("programs_with_modules");
  188. entity.Property(e => e.Id)
  189. .UseIdentityAlwaysColumn()
  190. .HasColumnName("id");
  191. entity.Property(e => e.IdModule).HasColumnName("id_module");
  192. entity.Property(e => e.IdRunningProgram).HasColumnName("id_running_program");
  193. entity.HasOne(d => d.IdModuleNavigation).WithMany(p => p.ProgramsWithModules)
  194. .HasForeignKey(d => d.IdModule)
  195. .HasConstraintName("programs_with_modules_fk_1");
  196. entity.HasOne(d => d.IdRunningProgramNavigation).WithMany(p => p.ProgramsWithModules)
  197. .HasForeignKey(d => d.IdRunningProgram)
  198. .HasConstraintName("programs_with_modules_fk");
  199. });
  200. modelBuilder.Entity<ProgramsWithStudent>(entity =>
  201. {
  202. entity.HasKey(e => e.Id).HasName("programs_with_students_pk");
  203. entity.ToTable("programs_with_students");
  204. entity.Property(e => e.Id)
  205. .UseIdentityAlwaysColumn()
  206. .HasColumnName("id");
  207. entity.Property(e => e.IdRunningProgram).HasColumnName("id_running_program");
  208. entity.Property(e => e.IdStudent).HasColumnName("id_student");
  209. entity.HasOne(d => d.IdRunningProgramNavigation).WithMany(p => p.ProgramsWithStudents)
  210. .HasForeignKey(d => d.IdRunningProgram)
  211. .HasConstraintName("programs_with_students_running_programs_fk");
  212. entity.HasOne(d => d.IdStudentNavigation).WithMany(p => p.ProgramsWithStudents)
  213. .HasForeignKey(d => d.IdStudent)
  214. .HasConstraintName("programs_with_students_students_fk");
  215. });
  216. modelBuilder.Entity<ProgramsWithSubject>(entity =>
  217. {
  218. entity.HasKey(e => e.Id).HasName("programs_with_subjects_pk");
  219. entity.ToTable("programs_with_subjects");
  220. entity.Property(e => e.Id)
  221. .UseIdentityAlwaysColumn()
  222. .HasColumnName("id");
  223. entity.Property(e => e.IdRunningProgram).HasColumnName("id_running_program");
  224. entity.Property(e => e.IdSubject).HasColumnName("id_subject");
  225. entity.Property(e => e.IdTeacher).HasColumnName("id_teacher");
  226. entity.Property(e => e.IdWay).HasColumnName("id_way");
  227. entity.Property(e => e.NumberOfHours).HasColumnName("number_of_hours");
  228. entity.HasOne(d => d.IdRunningProgramNavigation).WithMany(p => p.ProgramsWithSubjects)
  229. .HasForeignKey(d => d.IdRunningProgram)
  230. .HasConstraintName("programs_with_subjects_fk");
  231. entity.HasOne(d => d.IdSubjectNavigation).WithMany(p => p.ProgramsWithSubjects)
  232. .HasForeignKey(d => d.IdSubject)
  233. .HasConstraintName("programs_with_subjects_fk_1");
  234. entity.HasOne(d => d.IdTeacherNavigation).WithMany(p => p.ProgramsWithSubjects)
  235. .HasForeignKey(d => d.IdTeacher)
  236. .HasConstraintName("programs_with_subjects_fk_2");
  237. entity.HasOne(d => d.IdWayNavigation).WithMany(p => p.ProgramsWithSubjects)
  238. .HasForeignKey(d => d.IdWay)
  239. .HasConstraintName("programs_with_subjects_ways_to_change_fk");
  240. });
  241. modelBuilder.Entity<RunningProgram>(entity =>
  242. {
  243. entity.HasKey(e => e.IdRunningPrograms).HasName("running_programs_pk");
  244. entity.ToTable("running_programs");
  245. entity.Property(e => e.IdRunningPrograms)
  246. .UseIdentityAlwaysColumn()
  247. .HasColumnName("id_running_programs");
  248. entity.Property(e => e.DateEnd).HasColumnName("date_end");
  249. entity.Property(e => e.DateStart).HasColumnName("date_start");
  250. entity.Property(e => e.IdProgramTemplate).HasColumnName("id_program_template");
  251. entity.Property(e => e.IdSecretary).HasColumnName("id_secretary");
  252. entity.Property(e => e.IdStatus).HasColumnName("id_status");
  253. entity.Property(e => e.IdTrainingStandart).HasColumnName("id_training_standart");
  254. entity.Property(e => e.IdTutor).HasColumnName("id_tutor");
  255. entity.HasOne(d => d.IdProgramTemplateNavigation).WithMany(p => p.RunningPrograms)
  256. .HasForeignKey(d => d.IdProgramTemplate)
  257. .HasConstraintName("running_programs_fk");
  258. entity.HasOne(d => d.IdSecretaryNavigation).WithMany(p => p.RunningProgramIdSecretaryNavigations)
  259. .HasForeignKey(d => d.IdSecretary)
  260. .HasConstraintName("running_programs_fk_3");
  261. entity.HasOne(d => d.IdStatusNavigation).WithMany(p => p.RunningPrograms)
  262. .HasForeignKey(d => d.IdStatus)
  263. .HasConstraintName("running_programs_fk_1");
  264. entity.HasOne(d => d.IdTrainingStandartNavigation).WithMany(p => p.RunningPrograms)
  265. .HasForeignKey(d => d.IdTrainingStandart)
  266. .HasConstraintName("running_programs_training_standarts_fk");
  267. entity.HasOne(d => d.IdTutorNavigation).WithMany(p => p.RunningProgramIdTutorNavigations)
  268. .HasForeignKey(d => d.IdTutor)
  269. .HasConstraintName("running_programs_fk_2");
  270. });
  271. modelBuilder.Entity<Student>(entity =>
  272. {
  273. entity.HasKey(e => e.IdStudent).HasName("students_pk");
  274. entity.ToTable("students");
  275. entity.Property(e => e.IdStudent)
  276. .UseIdentityAlwaysColumn()
  277. .HasColumnName("id_student");
  278. entity.Property(e => e.Birthday).HasColumnName("birthday");
  279. entity.Property(e => e.IdEducation).HasColumnName("id_education");
  280. entity.Property(e => e.Name)
  281. .HasColumnType("character varying")
  282. .HasColumnName("name");
  283. entity.Property(e => e.Patronumic)
  284. .HasColumnType("character varying")
  285. .HasColumnName("patronumic");
  286. entity.Property(e => e.Surname)
  287. .HasColumnType("character varying")
  288. .HasColumnName("surname");
  289. entity.HasOne(d => d.IdEducationNavigation).WithMany(p => p.Students)
  290. .HasForeignKey(d => d.IdEducation)
  291. .HasConstraintName("students_fk");
  292. });
  293. modelBuilder.Entity<StudentsEducation>(entity =>
  294. {
  295. entity.HasKey(e => e.IdEducation).HasName("students_education_pk");
  296. entity.ToTable("students_education");
  297. entity.Property(e => e.IdEducation)
  298. .UseIdentityAlwaysColumn()
  299. .HasColumnName("id_education");
  300. entity.Property(e => e.Name)
  301. .HasColumnType("character varying")
  302. .HasColumnName("name");
  303. });
  304. modelBuilder.Entity<StudyListModulesStudent>(entity =>
  305. {
  306. entity.HasKey(e => e.Id).HasName("study_list_modules_students_pk");
  307. entity.ToTable("study_list_modules_students");
  308. entity.Property(e => e.Id)
  309. .UseIdentityAlwaysColumn()
  310. .HasColumnName("id");
  311. entity.Property(e => e.Grade).HasColumnName("grade");
  312. entity.Property(e => e.IdModule).HasColumnName("id_module");
  313. entity.Property(e => e.IdStudent).HasColumnName("id_student");
  314. entity.HasOne(d => d.IdModuleNavigation).WithMany(p => p.StudyListModulesStudents)
  315. .HasForeignKey(d => d.IdModule)
  316. .HasConstraintName("study_list_modules_students_fk");
  317. entity.HasOne(d => d.IdStudentNavigation).WithMany(p => p.StudyListModulesStudents)
  318. .HasForeignKey(d => d.IdStudent)
  319. .HasConstraintName("study_list_modules_students_fk_1");
  320. });
  321. modelBuilder.Entity<StudyListSubjectsStudent>(entity =>
  322. {
  323. entity.HasKey(e => e.Id).HasName("study_list_subjects_students_pk");
  324. entity.ToTable("study_list_subjects_students");
  325. entity.Property(e => e.Id)
  326. .UseIdentityAlwaysColumn()
  327. .HasColumnName("id");
  328. entity.Property(e => e.Grade).HasColumnName("grade");
  329. entity.Property(e => e.IdStudent).HasColumnName("id_student");
  330. entity.Property(e => e.IdSubject).HasColumnName("id_subject");
  331. entity.HasOne(d => d.GradeNavigation).WithMany(p => p.StudyListSubjectsStudents)
  332. .HasForeignKey(d => d.Grade)
  333. .OnDelete(DeleteBehavior.SetNull)
  334. .HasConstraintName("study_list_subjects_students_grade_fk");
  335. entity.HasOne(d => d.IdStudentNavigation).WithMany(p => p.StudyListSubjectsStudents)
  336. .HasForeignKey(d => d.IdStudent)
  337. .HasConstraintName("study_list_subjects_students_fk_1");
  338. entity.HasOne(d => d.IdSubjectNavigation).WithMany(p => p.StudyListSubjectsStudents)
  339. .HasForeignKey(d => d.IdSubject)
  340. .HasConstraintName("study_list_subjects_students_fk");
  341. });
  342. modelBuilder.Entity<Subject>(entity =>
  343. {
  344. entity.HasKey(e => e.IdSubject).HasName("subjects_pk");
  345. entity.ToTable("subjects");
  346. entity.Property(e => e.IdSubject)
  347. .UseIdentityAlwaysColumn()
  348. .HasColumnName("id_subject");
  349. entity.Property(e => e.IdCodeAcademicSubject)
  350. .HasColumnType("character varying")
  351. .HasColumnName("id_code_academic_subject");
  352. entity.Property(e => e.IdTrainingStandarts).HasColumnName("id_training_standarts");
  353. entity.Property(e => e.NameSubject)
  354. .HasColumnType("character varying")
  355. .HasColumnName("name_subject");
  356. entity.HasOne(d => d.IdCodeAcademicSubjectNavigation).WithMany(p => p.Subjects)
  357. .HasForeignKey(d => d.IdCodeAcademicSubject)
  358. .HasConstraintName("subjects_fk");
  359. entity.HasOne(d => d.IdTrainingStandartsNavigation).WithMany(p => p.Subjects)
  360. .HasForeignKey(d => d.IdTrainingStandarts)
  361. .HasConstraintName("subjects_fk_1");
  362. });
  363. modelBuilder.Entity<SystemRole>(entity =>
  364. {
  365. entity.HasKey(e => e.IdRole).HasName("system_roles_pk");
  366. entity.ToTable("system_roles");
  367. entity.Property(e => e.IdRole)
  368. .UseIdentityAlwaysColumn()
  369. .HasColumnName("id_role");
  370. entity.Property(e => e.RoleName)
  371. .HasColumnType("character varying")
  372. .HasColumnName("role_name");
  373. });
  374. modelBuilder.Entity<TrainingStandart>(entity =>
  375. {
  376. entity.HasKey(e => e.IdTrainingStandart).HasName("training_standarts_pk");
  377. entity.ToTable("training_standarts");
  378. entity.HasIndex(e => e.CodeTrainingStandart, "training_standarts_un").IsUnique();
  379. entity.Property(e => e.IdTrainingStandart)
  380. .UseIdentityAlwaysColumn()
  381. .HasColumnName("id_training_standart");
  382. entity.Property(e => e.CodeTrainingStandart)
  383. .HasColumnType("character varying")
  384. .HasColumnName("code_training_standart");
  385. entity.Property(e => e.NameTrainingStandart)
  386. .HasColumnType("character varying")
  387. .HasColumnName("name_training_standart");
  388. });
  389. modelBuilder.Entity<User>(entity =>
  390. {
  391. entity.HasKey(e => e.IdUser).HasName("users_pk");
  392. entity.ToTable("users");
  393. entity.Property(e => e.IdUser)
  394. .UseIdentityAlwaysColumn()
  395. .HasColumnName("id_user");
  396. entity.Property(e => e.Name)
  397. .HasColumnType("character varying")
  398. .HasColumnName("name");
  399. entity.Property(e => e.Patronumic)
  400. .HasColumnType("character varying")
  401. .HasColumnName("patronumic");
  402. entity.Property(e => e.Surname)
  403. .HasColumnType("character varying")
  404. .HasColumnName("surname");
  405. });
  406. modelBuilder.Entity<UsersLogin>(entity =>
  407. {
  408. entity.HasKey(e => e.UserEmail).HasName("users_login_pk");
  409. entity.ToTable("users_login");
  410. entity.HasIndex(e => e.IdUser, "users_login_un").IsUnique();
  411. entity.Property(e => e.UserEmail)
  412. .HasColumnType("character varying")
  413. .HasColumnName("user_email");
  414. entity.Property(e => e.IdUser).HasColumnName("id_user");
  415. entity.Property(e => e.Password)
  416. .HasColumnType("character varying")
  417. .HasColumnName("password");
  418. entity.HasOne(d => d.IdUserNavigation).WithOne(p => p.UsersLogin)
  419. .HasForeignKey<UsersLogin>(d => d.IdUser)
  420. .HasConstraintName("users_login_fk");
  421. });
  422. modelBuilder.Entity<UsersWithRole>(entity =>
  423. {
  424. entity.HasKey(e => e.Id).HasName("users_with_roles_pk");
  425. entity.ToTable("users_with_roles");
  426. entity.Property(e => e.Id)
  427. .UseIdentityAlwaysColumn()
  428. .HasColumnName("id");
  429. entity.Property(e => e.IdRole).HasColumnName("id_role");
  430. entity.Property(e => e.IdUser).HasColumnName("id_user");
  431. entity.HasOne(d => d.IdRoleNavigation).WithMany(p => p.UsersWithRoles)
  432. .HasForeignKey(d => d.IdRole)
  433. .HasConstraintName("users_with_roles_fk_1");
  434. entity.HasOne(d => d.IdUserNavigation).WithMany(p => p.UsersWithRoles)
  435. .HasForeignKey(d => d.IdUser)
  436. .HasConstraintName("users_with_roles_fk");
  437. });
  438. modelBuilder.Entity<WaysToChange>(entity =>
  439. {
  440. entity.HasKey(e => e.Id).HasName("ways_to_change_pk");
  441. entity.ToTable("ways_to_change");
  442. entity.Property(e => e.Id)
  443. .UseIdentityAlwaysColumn()
  444. .HasColumnName("id");
  445. entity.Property(e => e.Name)
  446. .HasColumnType("character varying")
  447. .HasColumnName("name");
  448. });
  449. OnModelCreatingPartial(modelBuilder);
  450. }
  451. partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
  452. }