20240531011555_RoleWhitelist.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #nullable disable
  2. using System;
  3. using Microsoft.EntityFrameworkCore.Migrations;
  4. namespace Content.Server.Database.Migrations.Postgres
  5. {
  6. /// <inheritdoc />
  7. public partial class RoleWhitelist : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "role_whitelists",
  14. columns: table => new
  15. {
  16. player_user_id = table.Column<Guid>(type: "uuid", nullable: false),
  17. role_id = table.Column<string>(type: "text", nullable: false)
  18. },
  19. constraints: table =>
  20. {
  21. table.PrimaryKey("PK_role_whitelists", x => new { x.player_user_id, x.role_id });
  22. table.ForeignKey(
  23. name: "FK_role_whitelists_player_player_user_id",
  24. column: x => x.player_user_id,
  25. principalTable: "player",
  26. principalColumn: "user_id",
  27. onDelete: ReferentialAction.Cascade);
  28. });
  29. }
  30. /// <inheritdoc />
  31. protected override void Down(MigrationBuilder migrationBuilder)
  32. {
  33. migrationBuilder.DropTable(
  34. name: "role_whitelists");
  35. }
  36. }
  37. }