1
0

20231024041159_DropAdminLogEntity.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #nullable disable
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace Content.Server.Database.Migrations.Sqlite
  4. {
  5. /// <inheritdoc />
  6. public partial class DropAdminLogEntity : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.DropTable(
  12. name: "admin_log_entity");
  13. }
  14. /// <inheritdoc />
  15. protected override void Down(MigrationBuilder migrationBuilder)
  16. {
  17. migrationBuilder.CreateTable(
  18. name: "admin_log_entity",
  19. columns: table => new
  20. {
  21. uid = table.Column<int>(type: "INTEGER", nullable: false)
  22. .Annotation("Sqlite:Autoincrement", true),
  23. admin_log_id = table.Column<int>(type: "INTEGER", nullable: true),
  24. admin_log_round_id = table.Column<int>(type: "INTEGER", nullable: true),
  25. name = table.Column<string>(type: "TEXT", nullable: true)
  26. },
  27. constraints: table =>
  28. {
  29. table.PrimaryKey("PK_admin_log_entity", x => x.uid);
  30. table.ForeignKey(
  31. name: "FK_admin_log_entity_admin_log_admin_log_id_admin_log_round_id",
  32. columns: x => new { x.admin_log_id, x.admin_log_round_id },
  33. principalTable: "admin_log",
  34. principalColumns: new[] { "admin_log_id", "round_id" });
  35. });
  36. migrationBuilder.CreateIndex(
  37. name: "IX_admin_log_entity_admin_log_id_admin_log_round_id",
  38. table: "admin_log_entity",
  39. columns: new[] { "admin_log_id", "admin_log_round_id" });
  40. }
  41. }
  42. }