1
0

20230319112120_ServerBanExemption.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Content.Server.Database.Migrations.Sqlite
  5. {
  6. public partial class ServerBanExemption : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.AddColumn<int>(
  11. name: "exempt_flags",
  12. table: "server_ban",
  13. type: "INTEGER",
  14. nullable: false,
  15. defaultValue: 0);
  16. migrationBuilder.CreateTable(
  17. name: "server_ban_exemption",
  18. columns: table => new
  19. {
  20. user_id = table.Column<Guid>(type: "TEXT", nullable: false),
  21. flags = table.Column<int>(type: "INTEGER", nullable: false)
  22. },
  23. constraints: table =>
  24. {
  25. table.PrimaryKey("PK_server_ban_exemption", x => x.user_id);
  26. table.CheckConstraint("FlagsNotZero", "flags != 0");
  27. });
  28. }
  29. protected override void Down(MigrationBuilder migrationBuilder)
  30. {
  31. migrationBuilder.DropTable(
  32. name: "server_ban_exemption");
  33. migrationBuilder.DropColumn(
  34. name: "exempt_flags",
  35. table: "server_ban");
  36. }
  37. }
  38. }