20240623005121_BanTemplate.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
  4. #nullable disable
  5. namespace Content.Server.Database.Migrations.Postgres
  6. {
  7. /// <inheritdoc />
  8. public partial class BanTemplate : Migration
  9. {
  10. /// <inheritdoc />
  11. protected override void Up(MigrationBuilder migrationBuilder)
  12. {
  13. migrationBuilder.CreateTable(
  14. name: "ban_template",
  15. columns: table => new
  16. {
  17. ban_template_id = table.Column<int>(type: "integer", nullable: false)
  18. .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
  19. title = table.Column<string>(type: "text", nullable: false),
  20. length = table.Column<TimeSpan>(type: "interval", nullable: false),
  21. reason = table.Column<string>(type: "text", nullable: false),
  22. exempt_flags = table.Column<int>(type: "integer", nullable: false),
  23. severity = table.Column<int>(type: "integer", nullable: false),
  24. auto_delete = table.Column<bool>(type: "boolean", nullable: false),
  25. hidden = table.Column<bool>(type: "boolean", nullable: false)
  26. },
  27. constraints: table =>
  28. {
  29. table.PrimaryKey("PK_ban_template", x => x.ban_template_id);
  30. });
  31. }
  32. /// <inheritdoc />
  33. protected override void Down(MigrationBuilder migrationBuilder)
  34. {
  35. migrationBuilder.DropTable(
  36. name: "ban_template");
  37. }
  38. }
  39. }