20230319110655_ProfileTraitIndexUnique.cs 1016 B

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Content.Server.Database.Migrations.Postgres
  4. {
  5. public partial class ProfileTraitIndexUnique : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.DropIndex(
  10. name: "IX_trait_profile_id",
  11. table: "trait");
  12. migrationBuilder.CreateIndex(
  13. name: "IX_trait_profile_id_trait_name",
  14. table: "trait",
  15. columns: new[] { "profile_id", "trait_name" },
  16. unique: true);
  17. }
  18. protected override void Down(MigrationBuilder migrationBuilder)
  19. {
  20. migrationBuilder.DropIndex(
  21. name: "IX_trait_profile_id_trait_name",
  22. table: "trait");
  23. migrationBuilder.CreateIndex(
  24. name: "IX_trait_profile_id",
  25. table: "trait",
  26. column: "profile_id");
  27. }
  28. }
  29. }