20240128145047_InitialCreate.Designer.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. // <auto-generated />
  2. using System;
  3. using MTWorkHR.Identity.DBContext;
  4. using Microsoft.EntityFrameworkCore;
  5. using Microsoft.EntityFrameworkCore.Infrastructure;
  6. using Microsoft.EntityFrameworkCore.Metadata;
  7. using Microsoft.EntityFrameworkCore.Migrations;
  8. using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
  9. #nullable disable
  10. namespace MTWorkHR.Identity.Migrations
  11. {
  12. [DbContext(typeof(HRIdentityDBContext))]
  13. [Migration("20240128145047_InitialCreate")]
  14. partial class InitialCreate
  15. {
  16. /// <inheritdoc />
  17. protected override void BuildTargetModel(ModelBuilder modelBuilder)
  18. {
  19. #pragma warning disable 612, 618
  20. modelBuilder
  21. .HasAnnotation("ProductVersion", "8.0.1")
  22. .HasAnnotation("Relational:MaxIdentifierLength", 128);
  23. SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
  24. modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
  25. {
  26. b.Property<string>("UserRolesId")
  27. .HasColumnType("nvarchar(450)");
  28. b.Property<string>("UsersId")
  29. .HasColumnType("nvarchar(450)");
  30. b.HasKey("UserRolesId", "UsersId");
  31. b.HasIndex("UsersId");
  32. b.ToTable("ApplicationRoleApplicationUser");
  33. });
  34. modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
  35. {
  36. b.Property<string>("Id")
  37. .HasColumnType("nvarchar(450)");
  38. b.Property<string>("ConcurrencyStamp")
  39. .IsConcurrencyToken()
  40. .HasColumnType("nvarchar(max)");
  41. b.Property<DateTime>("CreateDate")
  42. .HasColumnType("datetime2");
  43. b.Property<string>("CreateUser")
  44. .HasColumnType("nvarchar(max)");
  45. b.Property<string>("DeleteUserId")
  46. .HasColumnType("nvarchar(max)");
  47. b.Property<bool?>("IsAdmin")
  48. .HasColumnType("bit");
  49. b.Property<bool>("IsDeleted")
  50. .HasColumnType("bit");
  51. b.Property<string>("Name")
  52. .HasMaxLength(256)
  53. .HasColumnType("nvarchar(256)");
  54. b.Property<string>("NormalizedName")
  55. .HasMaxLength(256)
  56. .HasColumnType("nvarchar(256)");
  57. b.Property<DateTime?>("UpdateDate")
  58. .HasColumnType("datetime2");
  59. b.Property<string>("UpdateUser")
  60. .HasColumnType("nvarchar(max)");
  61. b.HasKey("Id");
  62. b.HasIndex("NormalizedName")
  63. .IsUnique()
  64. .HasDatabaseName("RoleNameIndex")
  65. .HasFilter("[NormalizedName] IS NOT NULL");
  66. b.ToTable("AspNetRoles", (string)null);
  67. b.HasData(
  68. new
  69. {
  70. Id = "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A",
  71. CreateDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
  72. IsAdmin = true,
  73. IsDeleted = false,
  74. Name = "Admin",
  75. NormalizedName = "ADMIN"
  76. },
  77. new
  78. {
  79. Id = "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E",
  80. CreateDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
  81. IsAdmin = false,
  82. IsDeleted = false,
  83. Name = "Employee",
  84. NormalizedName = "EMPLOYEE"
  85. });
  86. });
  87. modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
  88. {
  89. b.Property<string>("Id")
  90. .HasColumnType("nvarchar(450)");
  91. b.Property<int>("AccessFailedCount")
  92. .HasColumnType("int");
  93. b.Property<string>("ConcurrencyStamp")
  94. .IsConcurrencyToken()
  95. .HasColumnType("nvarchar(max)");
  96. b.Property<string>("CreateUser")
  97. .HasColumnType("nvarchar(max)");
  98. b.Property<string>("DeleteUserId")
  99. .HasColumnType("nvarchar(max)");
  100. b.Property<string>("Email")
  101. .HasMaxLength(256)
  102. .HasColumnType("nvarchar(256)");
  103. b.Property<bool>("EmailConfirmed")
  104. .HasColumnType("bit");
  105. b.Property<string>("FirstName")
  106. .IsRequired()
  107. .HasColumnType("nvarchar(max)");
  108. b.Property<bool>("IsDeleted")
  109. .HasColumnType("bit");
  110. b.Property<bool>("IsStopped")
  111. .HasColumnType("bit");
  112. b.Property<string>("LastName")
  113. .IsRequired()
  114. .HasColumnType("nvarchar(max)");
  115. b.Property<bool>("LockoutEnabled")
  116. .HasColumnType("bit");
  117. b.Property<DateTimeOffset?>("LockoutEnd")
  118. .HasColumnType("datetimeoffset");
  119. b.Property<string>("ManagerId")
  120. .HasColumnType("nvarchar(450)");
  121. b.Property<string>("NormalizedEmail")
  122. .HasMaxLength(256)
  123. .HasColumnType("nvarchar(256)");
  124. b.Property<string>("NormalizedUserName")
  125. .HasMaxLength(256)
  126. .HasColumnType("nvarchar(256)");
  127. b.Property<string>("PasswordHash")
  128. .HasColumnType("nvarchar(max)");
  129. b.Property<string>("PhoneNumber")
  130. .HasColumnType("nvarchar(max)");
  131. b.Property<bool>("PhoneNumberConfirmed")
  132. .HasColumnType("bit");
  133. b.Property<string>("SecurityStamp")
  134. .HasColumnType("nvarchar(max)");
  135. b.Property<bool>("TwoFactorEnabled")
  136. .HasColumnType("bit");
  137. b.Property<string>("UpdateUser")
  138. .HasColumnType("nvarchar(max)");
  139. b.Property<string>("UserName")
  140. .HasMaxLength(256)
  141. .HasColumnType("nvarchar(256)");
  142. b.Property<int>("UserType")
  143. .HasColumnType("int");
  144. b.HasKey("Id");
  145. b.HasIndex("ManagerId");
  146. b.HasIndex("NormalizedEmail")
  147. .HasDatabaseName("EmailIndex");
  148. b.HasIndex("NormalizedUserName")
  149. .IsUnique()
  150. .HasDatabaseName("UserNameIndex")
  151. .HasFilter("[NormalizedUserName] IS NOT NULL");
  152. b.ToTable("AspNetUsers", (string)null);
  153. b.HasData(
  154. new
  155. {
  156. Id = "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  157. AccessFailedCount = 0,
  158. ConcurrencyStamp = "7cc87689-9eab-4280-b8e3-1834080783a5",
  159. Email = "a@b.com",
  160. EmailConfirmed = true,
  161. FirstName = "Zinab",
  162. IsDeleted = false,
  163. IsStopped = false,
  164. LastName = "Elgendy",
  165. LockoutEnabled = false,
  166. NormalizedEmail = "A@B.COM",
  167. NormalizedUserName = "ADMIN",
  168. PasswordHash = "AQAAAAIAAYagAAAAEPg+ASbciPFxtyxQq8Wx5ilBUQ0RbAoITXXkOQm1PzC5BzySX0sn/wUmOjBKPDGV9w==",
  169. PhoneNumber = "1234567890",
  170. PhoneNumberConfirmed = true,
  171. SecurityStamp = "49bb16c3-4704-4c60-908d-dc8506950acc",
  172. TwoFactorEnabled = false,
  173. UserName = "Admin",
  174. UserType = 1
  175. },
  176. new
  177. {
  178. Id = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  179. AccessFailedCount = 0,
  180. ConcurrencyStamp = "4af7b4cf-802a-455b-b598-997e167745b3",
  181. Email = "ali@b.com",
  182. EmailConfirmed = true,
  183. FirstName = "Ali",
  184. IsDeleted = false,
  185. IsStopped = false,
  186. LastName = "Farok",
  187. LockoutEnabled = false,
  188. NormalizedEmail = "ALI@B.COM",
  189. NormalizedUserName = "ALI",
  190. PasswordHash = "AQAAAAIAAYagAAAAEI3QJkcZjCH4Y8Db4rEgL8Mmll5oCvYcWiXZjQSN9bGW4SMcjHe3ZPMnkN/l9DmJeQ==",
  191. PhoneNumber = "1234567890",
  192. PhoneNumberConfirmed = true,
  193. SecurityStamp = "62549056-1b9d-46d4-84f8-adea3e4d8b68",
  194. TwoFactorEnabled = false,
  195. UserName = "ali",
  196. UserType = 1
  197. });
  198. });
  199. modelBuilder.Entity("MTWorkHR.Identity.Entities.Permission", b =>
  200. {
  201. b.Property<long>("Id")
  202. .ValueGeneratedOnAdd()
  203. .HasColumnType("bigint")
  204. .HasColumnOrder(0);
  205. SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
  206. b.Property<string>("CategoryName")
  207. .IsRequired()
  208. .HasMaxLength(150)
  209. .HasColumnType("nvarchar(150)");
  210. b.Property<string>("Desc")
  211. .IsRequired()
  212. .HasMaxLength(250)
  213. .HasColumnType("nvarchar(250)");
  214. b.Property<string>("Name")
  215. .IsRequired()
  216. .HasMaxLength(250)
  217. .HasColumnType("nvarchar(250)");
  218. b.Property<bool>("Show")
  219. .HasColumnType("bit");
  220. b.HasKey("Id");
  221. b.ToTable("Permissions");
  222. });
  223. modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
  224. {
  225. b.Property<long>("Id")
  226. .ValueGeneratedOnAdd()
  227. .HasColumnType("bigint")
  228. .HasColumnOrder(0);
  229. SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
  230. b.Property<long>("PermissionId")
  231. .HasColumnType("bigint");
  232. b.Property<string>("PermissionName")
  233. .IsRequired()
  234. .HasColumnType("nvarchar(max)");
  235. b.Property<string>("RoleId")
  236. .IsRequired()
  237. .HasColumnType("nvarchar(450)");
  238. b.HasKey("Id");
  239. b.HasIndex("PermissionId");
  240. b.HasIndex("RoleId");
  241. b.ToTable("RolePermissions");
  242. });
  243. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
  244. {
  245. b.Property<int>("Id")
  246. .ValueGeneratedOnAdd()
  247. .HasColumnType("int");
  248. SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
  249. b.Property<string>("ClaimType")
  250. .HasColumnType("nvarchar(max)");
  251. b.Property<string>("ClaimValue")
  252. .HasColumnType("nvarchar(max)");
  253. b.Property<string>("RoleId")
  254. .IsRequired()
  255. .HasColumnType("nvarchar(450)");
  256. b.HasKey("Id");
  257. b.HasIndex("RoleId");
  258. b.ToTable("AspNetRoleClaims", (string)null);
  259. });
  260. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
  261. {
  262. b.Property<int>("Id")
  263. .ValueGeneratedOnAdd()
  264. .HasColumnType("int");
  265. SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
  266. b.Property<string>("ClaimType")
  267. .HasColumnType("nvarchar(max)");
  268. b.Property<string>("ClaimValue")
  269. .HasColumnType("nvarchar(max)");
  270. b.Property<string>("UserId")
  271. .IsRequired()
  272. .HasColumnType("nvarchar(450)");
  273. b.HasKey("Id");
  274. b.HasIndex("UserId");
  275. b.ToTable("AspNetUserClaims", (string)null);
  276. });
  277. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
  278. {
  279. b.Property<string>("LoginProvider")
  280. .HasColumnType("nvarchar(450)");
  281. b.Property<string>("ProviderKey")
  282. .HasColumnType("nvarchar(450)");
  283. b.Property<string>("ProviderDisplayName")
  284. .HasColumnType("nvarchar(max)");
  285. b.Property<string>("UserId")
  286. .IsRequired()
  287. .HasColumnType("nvarchar(450)");
  288. b.HasKey("LoginProvider", "ProviderKey");
  289. b.HasIndex("UserId");
  290. b.ToTable("AspNetUserLogins", (string)null);
  291. });
  292. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
  293. {
  294. b.Property<string>("UserId")
  295. .HasColumnType("nvarchar(450)");
  296. b.Property<string>("RoleId")
  297. .HasColumnType("nvarchar(450)");
  298. b.HasKey("UserId", "RoleId");
  299. b.HasIndex("RoleId");
  300. b.ToTable("AspNetUserRoles", (string)null);
  301. b.HasData(
  302. new
  303. {
  304. UserId = "ADMB3B92-2311-48F8-9DEC-F9FAEF1F21UA",
  305. RoleId = "AD5B3B92-2311-48F8-9DEC-F9FAEF1F211A"
  306. },
  307. new
  308. {
  309. UserId = "AL5B3B92-2311-48F8-9DEC-F9FAEF1F21UB",
  310. RoleId = "EM5B3B92-2311-48F8-9DEC-F9FAEF1F211E"
  311. });
  312. });
  313. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
  314. {
  315. b.Property<string>("UserId")
  316. .HasColumnType("nvarchar(450)");
  317. b.Property<string>("LoginProvider")
  318. .HasColumnType("nvarchar(450)");
  319. b.Property<string>("Name")
  320. .HasColumnType("nvarchar(450)");
  321. b.Property<string>("Value")
  322. .HasColumnType("nvarchar(max)");
  323. b.HasKey("UserId", "LoginProvider", "Name");
  324. b.ToTable("AspNetUserTokens", (string)null);
  325. });
  326. modelBuilder.Entity("ApplicationRoleApplicationUser", b =>
  327. {
  328. b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
  329. .WithMany()
  330. .HasForeignKey("UserRolesId")
  331. .OnDelete(DeleteBehavior.Cascade)
  332. .IsRequired();
  333. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
  334. .WithMany()
  335. .HasForeignKey("UsersId")
  336. .OnDelete(DeleteBehavior.Cascade)
  337. .IsRequired();
  338. });
  339. modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationUser", b =>
  340. {
  341. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", "Manager")
  342. .WithMany()
  343. .HasForeignKey("ManagerId");
  344. b.Navigation("Manager");
  345. });
  346. modelBuilder.Entity("MTWorkHR.Identity.Entities.RolePermission", b =>
  347. {
  348. b.HasOne("MTWorkHR.Identity.Entities.Permission", "Permission")
  349. .WithMany()
  350. .HasForeignKey("PermissionId")
  351. .OnDelete(DeleteBehavior.Cascade)
  352. .IsRequired();
  353. b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", "Role")
  354. .WithMany("RolePermissions")
  355. .HasForeignKey("RoleId")
  356. .OnDelete(DeleteBehavior.Cascade)
  357. .IsRequired();
  358. b.Navigation("Permission");
  359. b.Navigation("Role");
  360. });
  361. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
  362. {
  363. b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
  364. .WithMany()
  365. .HasForeignKey("RoleId")
  366. .OnDelete(DeleteBehavior.Cascade)
  367. .IsRequired();
  368. });
  369. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
  370. {
  371. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
  372. .WithMany()
  373. .HasForeignKey("UserId")
  374. .OnDelete(DeleteBehavior.Cascade)
  375. .IsRequired();
  376. });
  377. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
  378. {
  379. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
  380. .WithMany()
  381. .HasForeignKey("UserId")
  382. .OnDelete(DeleteBehavior.Cascade)
  383. .IsRequired();
  384. });
  385. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
  386. {
  387. b.HasOne("MTWorkHR.Identity.Entities.ApplicationRole", null)
  388. .WithMany()
  389. .HasForeignKey("RoleId")
  390. .OnDelete(DeleteBehavior.Cascade)
  391. .IsRequired();
  392. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
  393. .WithMany()
  394. .HasForeignKey("UserId")
  395. .OnDelete(DeleteBehavior.Cascade)
  396. .IsRequired();
  397. });
  398. modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
  399. {
  400. b.HasOne("MTWorkHR.Identity.Entities.ApplicationUser", null)
  401. .WithMany()
  402. .HasForeignKey("UserId")
  403. .OnDelete(DeleteBehavior.Cascade)
  404. .IsRequired();
  405. });
  406. modelBuilder.Entity("MTWorkHR.Identity.Entities.ApplicationRole", b =>
  407. {
  408. b.Navigation("RolePermissions");
  409. });
  410. #pragma warning restore 612, 618
  411. }
  412. }
  413. }