1
0

20220724000127_PlayTime.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Content.Server.Database.Migrations.Sqlite
  5. {
  6. public partial class PlayTime : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "play_time",
  12. columns: table => new
  13. {
  14. play_time_id = table.Column<int>(type: "INTEGER", nullable: false)
  15. .Annotation("Sqlite:Autoincrement", true),
  16. player_id = table.Column<Guid>(type: "TEXT", nullable: false),
  17. tracker = table.Column<string>(type: "TEXT", nullable: false),
  18. time_spent = table.Column<TimeSpan>(type: "TEXT", nullable: false)
  19. },
  20. constraints: table =>
  21. {
  22. table.PrimaryKey("PK_play_time", x => x.play_time_id);
  23. });
  24. migrationBuilder.CreateIndex(
  25. name: "IX_play_time_player_id_tracker",
  26. table: "play_time",
  27. columns: new[] { "player_id", "tracker" },
  28. unique: true);
  29. }
  30. protected override void Down(MigrationBuilder migrationBuilder)
  31. {
  32. migrationBuilder.DropTable(
  33. name: "play_time");
  34. }
  35. }
  36. }