20200514181226_AddActivityLog.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1601
  3. using System;
  4. using Microsoft.EntityFrameworkCore.Migrations;
  5. namespace Jellyfin.Server.Implementations.Migrations
  6. {
  7. public partial class AddActivityLog : Migration
  8. {
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.EnsureSchema(
  12. name: "jellyfin");
  13. migrationBuilder.CreateTable(
  14. name: "ActivityLogs",
  15. schema: "jellyfin",
  16. columns: table => new
  17. {
  18. Id = table.Column<int>(nullable: false)
  19. .Annotation("Sqlite:Autoincrement", true),
  20. Name = table.Column<string>(maxLength: 512, nullable: false),
  21. Overview = table.Column<string>(maxLength: 512, nullable: true),
  22. ShortOverview = table.Column<string>(maxLength: 512, nullable: true),
  23. Type = table.Column<string>(maxLength: 256, nullable: false),
  24. UserId = table.Column<Guid>(nullable: false),
  25. ItemId = table.Column<string>(maxLength: 256, nullable: true),
  26. DateCreated = table.Column<DateTime>(nullable: false),
  27. LogSeverity = table.Column<int>(nullable: false),
  28. RowVersion = table.Column<uint>(nullable: false)
  29. },
  30. constraints: table =>
  31. {
  32. table.PrimaryKey("PK_ActivityLogs", x => x.Id);
  33. });
  34. }
  35. protected override void Down(MigrationBuilder migrationBuilder)
  36. {
  37. migrationBuilder.DropTable(
  38. name: "ActivityLogs",
  39. schema: "jellyfin");
  40. }
  41. }
  42. }