EntranceTestingContext.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.EntityFrameworkCore;
  4. namespace EntranseTesting.Models;
  5. public partial class EntranceTestingContext : DbContext
  6. {
  7. public EntranceTestingContext()
  8. {
  9. }
  10. public EntranceTestingContext(DbContextOptions<EntranceTestingContext> options)
  11. : base(options)
  12. {
  13. }
  14. public virtual DbSet<AppSetting> AppSettings { get; set; }
  15. public virtual DbSet<Category> Categories { get; set; }
  16. public virtual DbSet<ElementOfArrangement> ElementOfArrangements { get; set; }
  17. public virtual DbSet<ElementOfChoose> ElementOfChooses { get; set; }
  18. public virtual DbSet<ElementOfEquality> ElementOfEqualities { get; set; }
  19. public virtual DbSet<ElementOfGroup> ElementOfGroups { get; set; }
  20. public virtual DbSet<ElementOfPutting> ElementOfPuttings { get; set; }
  21. public virtual DbSet<ElementOrientation> ElementOrientations { get; set; }
  22. public virtual DbSet<Group> Groups { get; set; }
  23. public virtual DbSet<HintImage> HintImages { get; set; }
  24. public virtual DbSet<HintText> HintTexts { get; set; }
  25. public virtual DbSet<Question> Questions { get; set; }
  26. public virtual DbSet<QuestionHint> QuestionHints { get; set; }
  27. public virtual DbSet<QuestionImage> QuestionImages { get; set; }
  28. public virtual DbSet<RatioOfElementEquality> RatioOfElementEqualities { get; set; }
  29. public virtual DbSet<RootUser> RootUsers { get; set; }
  30. public virtual DbSet<TextOfPutting> TextOfPuttings { get; set; }
  31. public virtual DbSet<UserResponse> UserResponses { get; set; }
  32. public virtual DbSet<UserResponseArrangement> UserResponseArrangements { get; set; }
  33. public virtual DbSet<UserResponseChooseAnswer> UserResponseChooseAnswers { get; set; }
  34. public virtual DbSet<UserResponseMatchTheElement> UserResponseMatchTheElements { get; set; }
  35. public virtual DbSet<UserResponseMatchTheValue> UserResponseMatchTheValues { get; set; }
  36. public virtual DbSet<UserResponseMultiplyAnswer> UserResponseMultiplyAnswers { get; set; }
  37. public virtual DbSet<UserSession> UserSessions { get; set; }
  38. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  39. #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 https://go.microsoft.com/fwlink/?LinkId=723263.
  40. => optionsBuilder.UseNpgsql("Host=ngknn.ru;Port=5442;Database=entrance_testing;Username=43P;Password=444444");
  41. protected override void OnModelCreating(ModelBuilder modelBuilder)
  42. {
  43. modelBuilder.Entity<AppSetting>(entity =>
  44. {
  45. entity.HasKey(e => e.Id).HasName("app_settings_pk");
  46. entity.ToTable("app_settings");
  47. entity.Property(e => e.Id)
  48. .UseIdentityAlwaysColumn()
  49. .HasColumnName("id");
  50. entity.Property(e => e.CountOfHints).HasColumnName("count_of_hints");
  51. entity.Property(e => e.CountOfQuestions).HasColumnName("count_of_questions");
  52. entity.Property(e => e.DateOfChanging)
  53. .HasColumnType("timestamp without time zone")
  54. .HasColumnName("date_of_changing");
  55. entity.Property(e => e.HintVisibility).HasColumnName("hint_visibility");
  56. entity.Property(e => e.Raiting3).HasColumnName("raiting3");
  57. entity.Property(e => e.Raiting4).HasColumnName("raiting4");
  58. entity.Property(e => e.Raiting5).HasColumnName("raiting5");
  59. entity.Property(e => e.ResultVisibiliry).HasColumnName("result_visibiliry");
  60. entity.Property(e => e.Time).HasColumnName("time");
  61. });
  62. modelBuilder.Entity<Category>(entity =>
  63. {
  64. entity.HasKey(e => e.Id).HasName("category_pk");
  65. entity.ToTable("category");
  66. entity.Property(e => e.Id)
  67. .UseIdentityAlwaysColumn()
  68. .HasColumnName("id");
  69. entity.Property(e => e.IdOrientation).HasColumnName("id_orientation");
  70. entity.Property(e => e.Name)
  71. .HasColumnType("character varying")
  72. .HasColumnName("name");
  73. entity.HasOne(d => d.IdOrientationNavigation).WithMany(p => p.Categories)
  74. .HasForeignKey(d => d.IdOrientation)
  75. .OnDelete(DeleteBehavior.Cascade)
  76. .HasConstraintName("category_element_orientation_fk");
  77. });
  78. modelBuilder.Entity<ElementOfArrangement>(entity =>
  79. {
  80. entity.HasKey(e => e.Id).HasName("element_of_arrangement_pk");
  81. entity.ToTable("element_of_arrangement");
  82. entity.Property(e => e.Id)
  83. .UseIdentityAlwaysColumn()
  84. .HasColumnName("id");
  85. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  86. entity.Property(e => e.Name)
  87. .HasColumnType("character varying")
  88. .HasColumnName("name");
  89. entity.Property(e => e.Position).HasColumnName("position");
  90. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.ElementOfArrangements)
  91. .HasForeignKey(d => d.IdQuestion)
  92. .HasConstraintName("element_of_arrangement_question_fk");
  93. });
  94. modelBuilder.Entity<ElementOfChoose>(entity =>
  95. {
  96. entity.HasKey(e => e.Id).HasName("element_of_choose_pk");
  97. entity.ToTable("element_of_choose");
  98. entity.Property(e => e.Id)
  99. .UseIdentityAlwaysColumn()
  100. .HasColumnName("id");
  101. entity.Property(e => e.Correctly).HasColumnName("correctly");
  102. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  103. entity.Property(e => e.Name)
  104. .HasColumnType("character varying")
  105. .HasColumnName("name");
  106. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.ElementOfChooses)
  107. .HasForeignKey(d => d.IdQuestion)
  108. .HasConstraintName("element_of_choose_question_fk");
  109. });
  110. modelBuilder.Entity<ElementOfEquality>(entity =>
  111. {
  112. entity.HasKey(e => e.Id).HasName("element_of_equality_pk");
  113. entity.ToTable("element_of_equality");
  114. entity.Property(e => e.Id)
  115. .UseIdentityAlwaysColumn()
  116. .HasColumnName("id");
  117. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  118. entity.Property(e => e.Name)
  119. .HasColumnType("character varying")
  120. .HasColumnName("name");
  121. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.ElementOfEqualities)
  122. .HasForeignKey(d => d.IdQuestion)
  123. .HasConstraintName("element_of_equality_question_fk");
  124. });
  125. modelBuilder.Entity<ElementOfGroup>(entity =>
  126. {
  127. entity.HasKey(e => e.Id).HasName("element_of_group_pk");
  128. entity.ToTable("element_of_group");
  129. entity.Property(e => e.Id)
  130. .UseIdentityAlwaysColumn()
  131. .HasColumnName("id");
  132. entity.Property(e => e.IdGroup).HasColumnName("id_group");
  133. entity.Property(e => e.Name)
  134. .HasColumnType("character varying")
  135. .HasColumnName("name");
  136. entity.Property(e => e.RatioNumeri).HasColumnName("ratio_numeri");
  137. entity.HasOne(d => d.IdGroupNavigation).WithMany(p => p.ElementOfGroups)
  138. .HasForeignKey(d => d.IdGroup)
  139. .HasConstraintName("element_of_group_group_fk");
  140. });
  141. modelBuilder.Entity<ElementOfPutting>(entity =>
  142. {
  143. entity.HasKey(e => e.Id).HasName("element_of_putting_pk");
  144. entity.ToTable("element_of_putting");
  145. entity.Property(e => e.Id)
  146. .UseIdentityAlwaysColumn()
  147. .HasColumnName("id");
  148. entity.Property(e => e.Correctly).HasColumnName("correctly");
  149. entity.Property(e => e.IdText).HasColumnName("id_text");
  150. entity.Property(e => e.Name)
  151. .HasColumnType("character varying")
  152. .HasColumnName("name");
  153. entity.HasOne(d => d.IdTextNavigation).WithMany(p => p.ElementOfPuttings)
  154. .HasForeignKey(d => d.IdText)
  155. .HasConstraintName("element_of_putting_text_of_putting_fk");
  156. });
  157. modelBuilder.Entity<ElementOrientation>(entity =>
  158. {
  159. entity.HasKey(e => e.Id).HasName("element_orientation_pk");
  160. entity.ToTable("element_orientation");
  161. entity.Property(e => e.Id)
  162. .UseIdentityAlwaysColumn()
  163. .HasColumnName("id");
  164. entity.Property(e => e.Name)
  165. .HasColumnType("character varying")
  166. .HasColumnName("name");
  167. });
  168. modelBuilder.Entity<Group>(entity =>
  169. {
  170. entity.HasKey(e => e.Id).HasName("group_pk");
  171. entity.ToTable("group");
  172. entity.Property(e => e.Id)
  173. .UseIdentityAlwaysColumn()
  174. .HasColumnName("id");
  175. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  176. entity.Property(e => e.Name)
  177. .HasColumnType("character varying")
  178. .HasColumnName("name");
  179. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.Groups)
  180. .HasForeignKey(d => d.IdQuestion)
  181. .HasConstraintName("group_question_fk");
  182. });
  183. modelBuilder.Entity<HintImage>(entity =>
  184. {
  185. entity.HasKey(e => e.Id).HasName("hint_image_pk");
  186. entity.ToTable("hint_image");
  187. entity.Property(e => e.Id)
  188. .UseIdentityAlwaysColumn()
  189. .HasColumnName("id");
  190. entity.Property(e => e.IdHint).HasColumnName("id_hint");
  191. entity.Property(e => e.Image).HasColumnName("image");
  192. entity.HasOne(d => d.IdHintNavigation).WithMany(p => p.HintImages)
  193. .HasForeignKey(d => d.IdHint)
  194. .HasConstraintName("hint_image_hint_text_fk");
  195. });
  196. modelBuilder.Entity<HintText>(entity =>
  197. {
  198. entity.HasKey(e => e.Id).HasName("hint_text_pk");
  199. entity.ToTable("hint_text");
  200. entity.Property(e => e.Id)
  201. .UseIdentityAlwaysColumn()
  202. .HasColumnName("id");
  203. entity.Property(e => e.Text)
  204. .HasColumnType("character varying")
  205. .HasColumnName("text");
  206. });
  207. modelBuilder.Entity<Question>(entity =>
  208. {
  209. entity.HasKey(e => e.Id).HasName("question_pk");
  210. entity.ToTable("question");
  211. entity.Property(e => e.Id)
  212. .UseIdentityAlwaysColumn()
  213. .HasColumnName("id");
  214. entity.Property(e => e.IdCategory).HasColumnName("id_category");
  215. entity.Property(e => e.InTest).HasColumnName("in_test");
  216. entity.Property(e => e.Name)
  217. .HasColumnType("character varying")
  218. .HasColumnName("name");
  219. entity.Property(e => e.Price).HasColumnName("price");
  220. entity.HasOne(d => d.IdCategoryNavigation).WithMany(p => p.Questions)
  221. .HasForeignKey(d => d.IdCategory)
  222. .HasConstraintName("question_category_fk");
  223. });
  224. modelBuilder.Entity<QuestionHint>(entity =>
  225. {
  226. entity.HasKey(e => e.Id).HasName("question_hint_pk");
  227. entity.ToTable("question_hint");
  228. entity.Property(e => e.Id)
  229. .UseIdentityAlwaysColumn()
  230. .HasColumnName("id");
  231. entity.Property(e => e.Cost).HasColumnName("cost");
  232. entity.Property(e => e.IdHint).HasColumnName("id_hint");
  233. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  234. entity.HasOne(d => d.IdHintNavigation).WithMany(p => p.QuestionHints)
  235. .HasForeignKey(d => d.IdHint)
  236. .HasConstraintName("question_hint_hint_text_fk");
  237. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.QuestionHints)
  238. .HasForeignKey(d => d.IdQuestion)
  239. .HasConstraintName("question_hint_question_fk");
  240. });
  241. modelBuilder.Entity<QuestionImage>(entity =>
  242. {
  243. entity.HasKey(e => e.Id).HasName("question_image_pk");
  244. entity.ToTable("question_image");
  245. entity.Property(e => e.Id)
  246. .UseIdentityAlwaysColumn()
  247. .HasColumnName("id");
  248. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  249. entity.Property(e => e.Image).HasColumnName("image");
  250. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.QuestionImages)
  251. .HasForeignKey(d => d.IdQuestion)
  252. .HasConstraintName("question_image_question_fk");
  253. });
  254. modelBuilder.Entity<RatioOfElementEquality>(entity =>
  255. {
  256. entity.HasKey(e => e.Id).HasName("ratio_of_element_equality_pk");
  257. entity.ToTable("ratio_of_element_equality");
  258. entity.Property(e => e.Id)
  259. .UseIdentityAlwaysColumn()
  260. .HasColumnName("id");
  261. entity.Property(e => e.IdElement1).HasColumnName("id_element1");
  262. entity.Property(e => e.IdElement2).HasColumnName("id_element2");
  263. entity.HasOne(d => d.IdElement1Navigation).WithMany(p => p.RatioOfElementEqualityIdElement1Navigations)
  264. .HasForeignKey(d => d.IdElement1)
  265. .HasConstraintName("ratio_of_element_equality_element_of_equality_fk");
  266. entity.HasOne(d => d.IdElement2Navigation).WithMany(p => p.RatioOfElementEqualityIdElement2Navigations)
  267. .HasForeignKey(d => d.IdElement2)
  268. .HasConstraintName("ratio_of_element_equality_element_of_equality_fk_1");
  269. });
  270. modelBuilder.Entity<RootUser>(entity =>
  271. {
  272. entity.HasKey(e => e.Id).HasName("rooy_users_pk");
  273. entity.ToTable("root_users");
  274. entity.Property(e => e.Id)
  275. .UseIdentityAlwaysColumn()
  276. .HasColumnName("id");
  277. entity.Property(e => e.Login)
  278. .HasColumnType("character varying")
  279. .HasColumnName("login");
  280. entity.Property(e => e.Name)
  281. .HasColumnType("character varying")
  282. .HasColumnName("name");
  283. entity.Property(e => e.Password)
  284. .HasColumnType("character varying")
  285. .HasColumnName("password");
  286. });
  287. modelBuilder.Entity<TextOfPutting>(entity =>
  288. {
  289. entity.HasKey(e => e.Id).HasName("text_of_putting_pk");
  290. entity.ToTable("text_of_putting");
  291. entity.Property(e => e.Id)
  292. .UseIdentityAlwaysColumn()
  293. .HasColumnName("id");
  294. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  295. entity.Property(e => e.Name)
  296. .HasColumnType("character varying")
  297. .HasColumnName("name");
  298. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.TextOfPuttings)
  299. .HasForeignKey(d => d.IdQuestion)
  300. .HasConstraintName("text_of_putting_question_fk");
  301. });
  302. modelBuilder.Entity<UserResponse>(entity =>
  303. {
  304. entity.HasKey(e => e.Id).HasName("user_responses_pk");
  305. entity.ToTable("user_responses");
  306. entity.Property(e => e.Id)
  307. .UseIdentityAlwaysColumn()
  308. .HasColumnName("id");
  309. entity.Property(e => e.Correctly).HasColumnName("correctly");
  310. entity.Property(e => e.HintApply).HasColumnName("hint_apply");
  311. entity.Property(e => e.IdQuestion).HasColumnName("id_question");
  312. entity.Property(e => e.IdSession).HasColumnName("id_session");
  313. entity.HasOne(d => d.IdQuestionNavigation).WithMany(p => p.UserResponses)
  314. .HasForeignKey(d => d.IdQuestion)
  315. .HasConstraintName("user_responses_question_fk");
  316. entity.HasOne(d => d.IdSessionNavigation).WithMany(p => p.UserResponses)
  317. .HasForeignKey(d => d.IdSession)
  318. .HasConstraintName("user_responses_user_session_fk");
  319. });
  320. modelBuilder.Entity<UserResponseArrangement>(entity =>
  321. {
  322. entity.HasKey(e => e.Id).HasName("user_response_arrangement_pk");
  323. entity.ToTable("user_response_arrangement");
  324. entity.Property(e => e.Id)
  325. .UseIdentityAlwaysColumn()
  326. .HasColumnName("id");
  327. entity.Property(e => e.IdElement).HasColumnName("id_element");
  328. entity.Property(e => e.IdResponse).HasColumnName("id_response");
  329. entity.Property(e => e.Position).HasColumnName("position");
  330. entity.HasOne(d => d.IdElementNavigation).WithMany(p => p.UserResponseArrangements)
  331. .HasForeignKey(d => d.IdElement)
  332. .HasConstraintName("user_response_arrangement_element_of_arrangement_fk");
  333. entity.HasOne(d => d.IdResponseNavigation).WithMany(p => p.UserResponseArrangements)
  334. .HasForeignKey(d => d.IdResponse)
  335. .HasConstraintName("user_response_arrangement_user_responses_fk");
  336. });
  337. modelBuilder.Entity<UserResponseChooseAnswer>(entity =>
  338. {
  339. entity.HasKey(e => e.Id).HasName("user_response_choose_answer_pk");
  340. entity.ToTable("user_response_choose_answer");
  341. entity.Property(e => e.Id)
  342. .UseIdentityAlwaysColumn()
  343. .HasColumnName("id");
  344. entity.Property(e => e.IdElement).HasColumnName("id_element");
  345. entity.Property(e => e.IdResponse).HasColumnName("id_response");
  346. entity.Property(e => e.Usercorrectly).HasColumnName("usercorrectly");
  347. entity.HasOne(d => d.IdElementNavigation).WithMany(p => p.UserResponseChooseAnswers)
  348. .HasForeignKey(d => d.IdElement)
  349. .HasConstraintName("user_response_choose_answer_element_of_choose_fk");
  350. entity.HasOne(d => d.IdResponseNavigation).WithMany(p => p.UserResponseChooseAnswers)
  351. .HasForeignKey(d => d.IdResponse)
  352. .HasConstraintName("user_response_choose_answer_user_responses_fk");
  353. });
  354. modelBuilder.Entity<UserResponseMatchTheElement>(entity =>
  355. {
  356. entity.HasKey(e => e.Id).HasName("user_response_match_the_element_pk");
  357. entity.ToTable("user_response_match_the_element");
  358. entity.Property(e => e.Id)
  359. .UseIdentityAlwaysColumn()
  360. .HasColumnName("id");
  361. entity.Property(e => e.IdElement1).HasColumnName("id_element1");
  362. entity.Property(e => e.IdElement2).HasColumnName("id_element2");
  363. entity.Property(e => e.IdResponse).HasColumnName("id_response");
  364. entity.HasOne(d => d.IdElement1Navigation).WithMany(p => p.UserResponseMatchTheElementIdElement1Navigations)
  365. .HasForeignKey(d => d.IdElement1)
  366. .HasConstraintName("user_response_match_the_element_element_of_group_fk");
  367. entity.HasOne(d => d.IdElement2Navigation).WithMany(p => p.UserResponseMatchTheElementIdElement2Navigations)
  368. .HasForeignKey(d => d.IdElement2)
  369. .HasConstraintName("user_response_match_the_element_element_of_group_fk_1");
  370. entity.HasOne(d => d.IdResponseNavigation).WithMany(p => p.UserResponseMatchTheElements)
  371. .HasForeignKey(d => d.IdResponse)
  372. .HasConstraintName("user_response_match_the_element_user_responses_fk");
  373. });
  374. modelBuilder.Entity<UserResponseMatchTheValue>(entity =>
  375. {
  376. entity.HasKey(e => e.Id).HasName("user_response_match_the_value_pk");
  377. entity.ToTable("user_response_match_the_value");
  378. entity.Property(e => e.Id)
  379. .UseIdentityAlwaysColumn()
  380. .HasColumnName("id");
  381. entity.Property(e => e.IdElement1).HasColumnName("id_element1");
  382. entity.Property(e => e.IdElement2).HasColumnName("id_element2");
  383. entity.Property(e => e.IdResponse).HasColumnName("id_response");
  384. entity.HasOne(d => d.IdElement1Navigation).WithMany(p => p.UserResponseMatchTheValueIdElement1Navigations)
  385. .HasForeignKey(d => d.IdElement1)
  386. .HasConstraintName("user_response_match_the_value_element_of_equality_fk");
  387. entity.HasOne(d => d.IdElement2Navigation).WithMany(p => p.UserResponseMatchTheValueIdElement2Navigations)
  388. .HasForeignKey(d => d.IdElement2)
  389. .HasConstraintName("user_response_match_the_value_element_of_equality_fk_1");
  390. entity.HasOne(d => d.IdResponseNavigation).WithMany(p => p.UserResponseMatchTheValues)
  391. .HasForeignKey(d => d.IdResponse)
  392. .HasConstraintName("user_response_match_the_value_user_responses_fk");
  393. });
  394. modelBuilder.Entity<UserResponseMultiplyAnswer>(entity =>
  395. {
  396. entity.HasKey(e => e.Id).HasName("user_response_multiply_answer_pk");
  397. entity.ToTable("user_response_multiply_answer");
  398. entity.Property(e => e.Id)
  399. .UseIdentityAlwaysColumn()
  400. .HasColumnName("id");
  401. entity.Property(e => e.IdElement).HasColumnName("id_element");
  402. entity.Property(e => e.IdResponse).HasColumnName("id_response");
  403. entity.Property(e => e.IdText).HasColumnName("id_text");
  404. entity.HasOne(d => d.IdElementNavigation).WithMany(p => p.UserResponseMultiplyAnswers)
  405. .HasForeignKey(d => d.IdElement)
  406. .HasConstraintName("user_response_multiply_answer_element_of_putting_fk");
  407. entity.HasOne(d => d.IdResponseNavigation).WithMany(p => p.UserResponseMultiplyAnswers)
  408. .HasForeignKey(d => d.IdResponse)
  409. .HasConstraintName("user_response_multiply_answer_user_responses_fk");
  410. entity.HasOne(d => d.IdTextNavigation).WithMany(p => p.UserResponseMultiplyAnswers)
  411. .HasForeignKey(d => d.IdText)
  412. .HasConstraintName("user_response_multiply_answer_text_of_putting_fk");
  413. });
  414. modelBuilder.Entity<UserSession>(entity =>
  415. {
  416. entity.HasKey(e => e.Id).HasName("user_session_pk");
  417. entity.ToTable("user_session");
  418. entity.Property(e => e.Id)
  419. .UseIdentityAlwaysColumn()
  420. .HasColumnName("id");
  421. entity.Property(e => e.CountHint).HasColumnName("count_hint");
  422. entity.Property(e => e.Date)
  423. .HasColumnType("timestamp without time zone")
  424. .HasColumnName("date");
  425. entity.Property(e => e.IdAppSettings).HasColumnName("id_app_settings");
  426. entity.Property(e => e.Time).HasColumnName("time");
  427. entity.Property(e => e.UserGroup)
  428. .HasColumnType("character varying")
  429. .HasColumnName("user_group");
  430. entity.Property(e => e.UserName)
  431. .HasColumnType("character varying")
  432. .HasColumnName("user_name");
  433. entity.HasOne(d => d.IdAppSettingsNavigation).WithMany(p => p.UserSessions)
  434. .HasForeignKey(d => d.IdAppSettings)
  435. .OnDelete(DeleteBehavior.Cascade)
  436. .HasConstraintName("user_session_app_settings_fk");
  437. });
  438. OnModelCreatingPartial(modelBuilder);
  439. }
  440. partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
  441. }