20240403072258_Loadouts.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Content.Server.Database.Migrations.Sqlite
  4. {
  5. /// <inheritdoc />
  6. public partial class Loadouts : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.CreateTable(
  12. name: "profile_role_loadout",
  13. columns: table => new
  14. {
  15. profile_role_loadout_id = table.Column<int>(type: "INTEGER", nullable: false)
  16. .Annotation("Sqlite:Autoincrement", true),
  17. profile_id = table.Column<int>(type: "INTEGER", nullable: false),
  18. role_name = table.Column<string>(type: "TEXT", nullable: false)
  19. },
  20. constraints: table =>
  21. {
  22. table.PrimaryKey("PK_profile_role_loadout", x => x.profile_role_loadout_id);
  23. table.ForeignKey(
  24. name: "FK_profile_role_loadout_profile_profile_id",
  25. column: x => x.profile_id,
  26. principalTable: "profile",
  27. principalColumn: "profile_id",
  28. onDelete: ReferentialAction.Cascade);
  29. });
  30. migrationBuilder.CreateTable(
  31. name: "profile_loadout_group",
  32. columns: table => new
  33. {
  34. profile_loadout_group_id = table.Column<int>(type: "INTEGER", nullable: false)
  35. .Annotation("Sqlite:Autoincrement", true),
  36. profile_role_loadout_id = table.Column<int>(type: "INTEGER", nullable: false),
  37. group_name = table.Column<string>(type: "TEXT", nullable: false)
  38. },
  39. constraints: table =>
  40. {
  41. table.PrimaryKey("PK_profile_loadout_group", x => x.profile_loadout_group_id);
  42. table.ForeignKey(
  43. name: "FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id",
  44. column: x => x.profile_role_loadout_id,
  45. principalTable: "profile_role_loadout",
  46. principalColumn: "profile_role_loadout_id",
  47. onDelete: ReferentialAction.Cascade);
  48. });
  49. migrationBuilder.CreateTable(
  50. name: "profile_loadout",
  51. columns: table => new
  52. {
  53. profile_loadout_id = table.Column<int>(type: "INTEGER", nullable: false)
  54. .Annotation("Sqlite:Autoincrement", true),
  55. profile_loadout_group_id = table.Column<int>(type: "INTEGER", nullable: false),
  56. loadout_name = table.Column<string>(type: "TEXT", nullable: false)
  57. },
  58. constraints: table =>
  59. {
  60. table.PrimaryKey("PK_profile_loadout", x => x.profile_loadout_id);
  61. table.ForeignKey(
  62. name: "FK_profile_loadout_profile_loadout_group_profile_loadout_group_id",
  63. column: x => x.profile_loadout_group_id,
  64. principalTable: "profile_loadout_group",
  65. principalColumn: "profile_loadout_group_id",
  66. onDelete: ReferentialAction.Cascade);
  67. });
  68. migrationBuilder.CreateIndex(
  69. name: "IX_profile_loadout_profile_loadout_group_id",
  70. table: "profile_loadout",
  71. column: "profile_loadout_group_id");
  72. migrationBuilder.CreateIndex(
  73. name: "IX_profile_loadout_group_profile_role_loadout_id",
  74. table: "profile_loadout_group",
  75. column: "profile_role_loadout_id");
  76. migrationBuilder.CreateIndex(
  77. name: "IX_profile_role_loadout_profile_id",
  78. table: "profile_role_loadout",
  79. column: "profile_id");
  80. }
  81. /// <inheritdoc />
  82. protected override void Down(MigrationBuilder migrationBuilder)
  83. {
  84. migrationBuilder.DropTable(
  85. name: "profile_loadout");
  86. migrationBuilder.DropTable(
  87. name: "profile_loadout_group");
  88. migrationBuilder.DropTable(
  89. name: "profile_role_loadout");
  90. }
  91. }
  92. }