20240526150638_permissionConfig.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
  4. namespace MTWorkHR.Infrastructure.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class permissionConfig : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.UpdateData(
  13. table: "AttachmentTypes",
  14. keyColumn: "Id",
  15. keyValue: 2L,
  16. columns: new[] { "NameAr", "NameEn" },
  17. values: new object[] { "جواز السفر", "Passport" });
  18. migrationBuilder.InsertData(
  19. table: "AttachmentTypes",
  20. columns: new[] { "Id", "IsRequired", "NameAr", "NameEn" },
  21. values: new object[,]
  22. {
  23. { 6L, false, "شهادة الاحتراف", "Commercial Regestration" },
  24. { 7L, false, "البطاقة الضريبية", "Tax Declaration" },
  25. { 8L, false, "الهوية", "Identification" }
  26. });
  27. migrationBuilder.InsertData(
  28. table: "Permissions",
  29. columns: new[] { "Id", "CategoryName", "Desc", "Name", "Show" },
  30. values: new object[,]
  31. {
  32. { 1L, "User", "Project", "Project", true },
  33. { 2L, "User", "Project.Create", "Project.Create", false },
  34. { 3L, "User", "Project.Update", "Project.Update", false },
  35. { 4L, "User", "Project.Delete", "Project.Delete", false },
  36. { 5L, "User", "Meeting", "Meeting", true },
  37. { 6L, "User", "Meeting.Create", "Meeting.Create", false },
  38. { 7L, "User", "Meeting.Update", "Meeting.Update", false },
  39. { 8L, "User", "Meeting.Delete", "Meeting.Delete", false },
  40. { 9L, "User", "Team", "Team", true },
  41. { 10L, "User", "Team.Create", "Team.Create", false },
  42. { 11L, "User", "Team.Update", "Team.Update", false },
  43. { 12L, "User", "Team.Delete", "Team.Delete", false },
  44. { 13L, "Sales", "UserTask", "UserTask", true },
  45. { 14L, "Sales", "UserTask.Create", "UserTask.Create", false },
  46. { 15L, "Sales", "UserTask.Update", "UserTask.Update", false },
  47. { 16L, "User", "UserTask.Delete", "UserTask.Delete", false },
  48. { 17L, "User", "Company", "Company", true },
  49. { 18L, "User", "Company.Create", "Company.Create", false },
  50. { 19L, "User", "Company.Update", "Company.Update", false },
  51. { 20L, "User", "Company.Delete", "Company.Delete", false },
  52. { 21L, "Adminstration", "User", "User", true },
  53. { 22L, "Adminstration", "User.Create", "User.Create", false },
  54. { 23L, "Adminstration", "User.Update", "User.Update", false },
  55. { 24L, "Adminstration", "User.Delete", "User.Delete", false },
  56. { 25L, "Adminstration", "Role", "Role", true },
  57. { 26L, "Adminstration", "Role.Create", "Role.Create", false },
  58. { 27L, "Adminstration", "Role.Update", "Role.Update", false },
  59. { 28L, "Adminstration", "Role.Delete", "Role.Delete", false }
  60. });
  61. }
  62. /// <inheritdoc />
  63. protected override void Down(MigrationBuilder migrationBuilder)
  64. {
  65. migrationBuilder.DeleteData(
  66. table: "AttachmentTypes",
  67. keyColumn: "Id",
  68. keyValue: 6L);
  69. migrationBuilder.DeleteData(
  70. table: "AttachmentTypes",
  71. keyColumn: "Id",
  72. keyValue: 7L);
  73. migrationBuilder.DeleteData(
  74. table: "AttachmentTypes",
  75. keyColumn: "Id",
  76. keyValue: 8L);
  77. migrationBuilder.DeleteData(
  78. table: "Permissions",
  79. keyColumn: "Id",
  80. keyValue: 1L);
  81. migrationBuilder.DeleteData(
  82. table: "Permissions",
  83. keyColumn: "Id",
  84. keyValue: 2L);
  85. migrationBuilder.DeleteData(
  86. table: "Permissions",
  87. keyColumn: "Id",
  88. keyValue: 3L);
  89. migrationBuilder.DeleteData(
  90. table: "Permissions",
  91. keyColumn: "Id",
  92. keyValue: 4L);
  93. migrationBuilder.DeleteData(
  94. table: "Permissions",
  95. keyColumn: "Id",
  96. keyValue: 5L);
  97. migrationBuilder.DeleteData(
  98. table: "Permissions",
  99. keyColumn: "Id",
  100. keyValue: 6L);
  101. migrationBuilder.DeleteData(
  102. table: "Permissions",
  103. keyColumn: "Id",
  104. keyValue: 7L);
  105. migrationBuilder.DeleteData(
  106. table: "Permissions",
  107. keyColumn: "Id",
  108. keyValue: 8L);
  109. migrationBuilder.DeleteData(
  110. table: "Permissions",
  111. keyColumn: "Id",
  112. keyValue: 9L);
  113. migrationBuilder.DeleteData(
  114. table: "Permissions",
  115. keyColumn: "Id",
  116. keyValue: 10L);
  117. migrationBuilder.DeleteData(
  118. table: "Permissions",
  119. keyColumn: "Id",
  120. keyValue: 11L);
  121. migrationBuilder.DeleteData(
  122. table: "Permissions",
  123. keyColumn: "Id",
  124. keyValue: 12L);
  125. migrationBuilder.DeleteData(
  126. table: "Permissions",
  127. keyColumn: "Id",
  128. keyValue: 13L);
  129. migrationBuilder.DeleteData(
  130. table: "Permissions",
  131. keyColumn: "Id",
  132. keyValue: 14L);
  133. migrationBuilder.DeleteData(
  134. table: "Permissions",
  135. keyColumn: "Id",
  136. keyValue: 15L);
  137. migrationBuilder.DeleteData(
  138. table: "Permissions",
  139. keyColumn: "Id",
  140. keyValue: 16L);
  141. migrationBuilder.DeleteData(
  142. table: "Permissions",
  143. keyColumn: "Id",
  144. keyValue: 17L);
  145. migrationBuilder.DeleteData(
  146. table: "Permissions",
  147. keyColumn: "Id",
  148. keyValue: 18L);
  149. migrationBuilder.DeleteData(
  150. table: "Permissions",
  151. keyColumn: "Id",
  152. keyValue: 19L);
  153. migrationBuilder.DeleteData(
  154. table: "Permissions",
  155. keyColumn: "Id",
  156. keyValue: 20L);
  157. migrationBuilder.DeleteData(
  158. table: "Permissions",
  159. keyColumn: "Id",
  160. keyValue: 21L);
  161. migrationBuilder.DeleteData(
  162. table: "Permissions",
  163. keyColumn: "Id",
  164. keyValue: 22L);
  165. migrationBuilder.DeleteData(
  166. table: "Permissions",
  167. keyColumn: "Id",
  168. keyValue: 23L);
  169. migrationBuilder.DeleteData(
  170. table: "Permissions",
  171. keyColumn: "Id",
  172. keyValue: 24L);
  173. migrationBuilder.DeleteData(
  174. table: "Permissions",
  175. keyColumn: "Id",
  176. keyValue: 25L);
  177. migrationBuilder.DeleteData(
  178. table: "Permissions",
  179. keyColumn: "Id",
  180. keyValue: 26L);
  181. migrationBuilder.DeleteData(
  182. table: "Permissions",
  183. keyColumn: "Id",
  184. keyValue: 27L);
  185. migrationBuilder.DeleteData(
  186. table: "Permissions",
  187. keyColumn: "Id",
  188. keyValue: 28L);
  189. migrationBuilder.UpdateData(
  190. table: "AttachmentTypes",
  191. keyColumn: "Id",
  192. keyValue: 2L,
  193. columns: new[] { "NameAr", "NameEn" },
  194. values: new object[] { "الهوية", "Identification" });
  195. }
  196. }
  197. }