20241117103737_InitialCreate.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Waaagh.Migrations {
  4. /// <inheritdoc />
  5. public partial class InitialCreate: Migration {
  6. /// <inheritdoc />
  7. protected override void Up(MigrationBuilder migrationBuilder) {
  8. migrationBuilder.CreateTable(
  9. name: "Message",
  10. columns: table => new {
  11. Key = table.Column<int>(type: "INTEGER", nullable: false)
  12. .Annotation("Sqlite:Autoincrement", true),
  13. Channel = table.Column<short>(type: "INTEGER", nullable: false),
  14. Reply = table.Column<bool>(type: "INTEGER", nullable: false),
  15. Name = table.Column<string>(type: "TEXT", nullable: false),
  16. Content = table.Column<string>(type: "TEXT", nullable: false)
  17. },
  18. constraints: table => {
  19. table.PrimaryKey("PK_Message", x => x.Key);
  20. });
  21. migrationBuilder.CreateTable(
  22. name: "Scenarios",
  23. columns: table => new {
  24. Id = table.Column<int>(type: "INTEGER", nullable: false)
  25. .Annotation("Sqlite:Autoincrement", true),
  26. Name = table.Column<string>(type: "TEXT", nullable: false),
  27. Description = table.Column<string>(type: "TEXT", nullable: false),
  28. LastUpdateTime = table.Column<DateTime>(type: "TEXT", nullable: false),
  29. Version = table.Column<int>(type: "INTEGER", nullable: false),
  30. IsLegacy = table.Column<bool>(type: "INTEGER", nullable: false)
  31. },
  32. constraints: table => {
  33. table.PrimaryKey("PK_Scenarios", x => x.Id);
  34. });
  35. }
  36. /// <inheritdoc />
  37. protected override void Down(MigrationBuilder migrationBuilder) {
  38. migrationBuilder.DropTable(
  39. name: "Message");
  40. migrationBuilder.DropTable(
  41. name: "Scenarios");
  42. }
  43. }
  44. }