20240218144219_addLogs.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace MTWorkHR.Infrastructure.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class addLogs : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "AuthLogs",
  14. columns: table => new
  15. {
  16. Id = table.Column<long>(type: "bigint", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
  19. QueryString = table.Column<string>(type: "nvarchar(max)", nullable: false),
  20. Input = table.Column<string>(type: "nvarchar(max)", nullable: false),
  21. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  22. CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
  23. ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  24. Channel = table.Column<string>(type: "nvarchar(max)", nullable: false),
  25. UserIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  26. ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
  27. ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
  28. ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
  29. InnerException = table.Column<string>(type: "nvarchar(max)", nullable: false),
  30. userAgent = table.Column<string>(type: "nvarchar(max)", nullable: false)
  31. },
  32. constraints: table =>
  33. {
  34. table.PrimaryKey("PK_AuthLogs", x => x.Id);
  35. });
  36. migrationBuilder.CreateTable(
  37. name: "Companies",
  38. columns: table => new
  39. {
  40. Id = table.Column<long>(type: "bigint", nullable: false)
  41. .Annotation("SqlServer:Identity", "1, 1"),
  42. CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
  43. UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
  44. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  45. UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
  46. UserId = table.Column<long>(type: "bigint", nullable: false),
  47. CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
  48. CRNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
  49. TaxNumber = table.Column<int>(type: "int", nullable: false),
  50. IsDeleted = table.Column<bool>(type: "bit", nullable: false)
  51. },
  52. constraints: table =>
  53. {
  54. table.PrimaryKey("PK_Companies", x => x.Id);
  55. });
  56. migrationBuilder.CreateTable(
  57. name: "FileLogs",
  58. columns: table => new
  59. {
  60. Id = table.Column<long>(type: "bigint", nullable: false)
  61. .Annotation("SqlServer:Identity", "1, 1"),
  62. Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
  63. QueryString = table.Column<string>(type: "nvarchar(max)", nullable: false),
  64. Input = table.Column<string>(type: "nvarchar(max)", nullable: false),
  65. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  66. CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
  67. ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  68. Channel = table.Column<string>(type: "nvarchar(max)", nullable: false),
  69. UserIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  70. ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
  71. ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
  72. ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
  73. InnerException = table.Column<string>(type: "nvarchar(max)", nullable: false),
  74. userAgent = table.Column<string>(type: "nvarchar(max)", nullable: false)
  75. },
  76. constraints: table =>
  77. {
  78. table.PrimaryKey("PK_FileLogs", x => x.Id);
  79. });
  80. migrationBuilder.CreateTable(
  81. name: "RoleLogs",
  82. columns: table => new
  83. {
  84. Id = table.Column<long>(type: "bigint", nullable: false)
  85. .Annotation("SqlServer:Identity", "1, 1"),
  86. Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
  87. QueryString = table.Column<string>(type: "nvarchar(max)", nullable: false),
  88. Input = table.Column<string>(type: "nvarchar(max)", nullable: false),
  89. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  90. CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
  91. ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  92. Channel = table.Column<string>(type: "nvarchar(max)", nullable: false),
  93. UserIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  94. ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
  95. ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
  96. ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
  97. InnerException = table.Column<string>(type: "nvarchar(max)", nullable: false),
  98. userAgent = table.Column<string>(type: "nvarchar(max)", nullable: false)
  99. },
  100. constraints: table =>
  101. {
  102. table.PrimaryKey("PK_RoleLogs", x => x.Id);
  103. });
  104. migrationBuilder.CreateTable(
  105. name: "SettingLogs",
  106. columns: table => new
  107. {
  108. Id = table.Column<long>(type: "bigint", nullable: false)
  109. .Annotation("SqlServer:Identity", "1, 1"),
  110. Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
  111. QueryString = table.Column<string>(type: "nvarchar(max)", nullable: false),
  112. Input = table.Column<string>(type: "nvarchar(max)", nullable: false),
  113. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  114. CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
  115. ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  116. Channel = table.Column<string>(type: "nvarchar(max)", nullable: false),
  117. UserIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  118. ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
  119. ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
  120. ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
  121. InnerException = table.Column<string>(type: "nvarchar(max)", nullable: false),
  122. userAgent = table.Column<string>(type: "nvarchar(max)", nullable: false)
  123. },
  124. constraints: table =>
  125. {
  126. table.PrimaryKey("PK_SettingLogs", x => x.Id);
  127. });
  128. migrationBuilder.CreateTable(
  129. name: "UserLogs",
  130. columns: table => new
  131. {
  132. Id = table.Column<long>(type: "bigint", nullable: false)
  133. .Annotation("SqlServer:Identity", "1, 1"),
  134. Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
  135. QueryString = table.Column<string>(type: "nvarchar(max)", nullable: false),
  136. Input = table.Column<string>(type: "nvarchar(max)", nullable: false),
  137. CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
  138. CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
  139. ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  140. Channel = table.Column<string>(type: "nvarchar(max)", nullable: false),
  141. UserIP = table.Column<string>(type: "nvarchar(max)", nullable: false),
  142. ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
  143. ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
  144. ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
  145. InnerException = table.Column<string>(type: "nvarchar(max)", nullable: false),
  146. userAgent = table.Column<string>(type: "nvarchar(max)", nullable: false)
  147. },
  148. constraints: table =>
  149. {
  150. table.PrimaryKey("PK_UserLogs", x => x.Id);
  151. });
  152. }
  153. /// <inheritdoc />
  154. protected override void Down(MigrationBuilder migrationBuilder)
  155. {
  156. migrationBuilder.DropTable(
  157. name: "AuthLogs");
  158. migrationBuilder.DropTable(
  159. name: "Companies");
  160. migrationBuilder.DropTable(
  161. name: "FileLogs");
  162. migrationBuilder.DropTable(
  163. name: "RoleLogs");
  164. migrationBuilder.DropTable(
  165. name: "SettingLogs");
  166. migrationBuilder.DropTable(
  167. name: "UserLogs");
  168. }
  169. }
  170. }