2020-12-03 20:51:12 +00:00
|
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Implementations.Migrations
|
|
|
|
|
{
|
|
|
|
|
public partial class AddCustomDisplayPreferences : Migration
|
|
|
|
|
{
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
2020-12-04 23:00:11 +00:00
|
|
|
|
migrationBuilder.DropIndex(
|
|
|
|
|
name: "IX_DisplayPreferences_UserId_Client",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences");
|
|
|
|
|
|
2020-12-03 20:51:12 +00:00
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
|
|
|
name: "MaxActiveSessions",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "Users",
|
|
|
|
|
type: "INTEGER",
|
|
|
|
|
nullable: false,
|
|
|
|
|
defaultValue: 0,
|
|
|
|
|
oldClrType: typeof(int),
|
|
|
|
|
oldType: "INTEGER",
|
|
|
|
|
oldNullable: true);
|
|
|
|
|
|
2020-12-04 23:00:11 +00:00
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
|
|
|
name: "ItemId",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences",
|
|
|
|
|
type: "TEXT",
|
|
|
|
|
nullable: false,
|
|
|
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
|
|
2020-12-03 20:51:12 +00:00
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "CustomItemDisplayPreferences",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
UserId = table.Column<Guid>(type: "TEXT", nullable: false),
|
2020-12-04 23:00:11 +00:00
|
|
|
|
ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
|
2020-12-03 20:51:12 +00:00
|
|
|
|
Client = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
|
|
|
|
|
Key = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Value = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_CustomItemDisplayPreferences", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
2020-12-04 23:00:11 +00:00
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_DisplayPreferences_UserId_ItemId_Client",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences",
|
|
|
|
|
columns: new[] { "UserId", "ItemId", "Client" },
|
|
|
|
|
unique: true);
|
|
|
|
|
|
2020-12-03 20:51:12 +00:00
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_CustomItemDisplayPreferences_UserId",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "CustomItemDisplayPreferences",
|
|
|
|
|
column: "UserId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2020-12-04 23:00:11 +00:00
|
|
|
|
name: "IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key",
|
2020-12-03 20:51:12 +00:00
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "CustomItemDisplayPreferences",
|
2020-12-04 23:00:11 +00:00
|
|
|
|
columns: new[] { "UserId", "ItemId", "Client", "Key" },
|
2020-12-03 20:51:12 +00:00
|
|
|
|
unique: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "CustomItemDisplayPreferences",
|
|
|
|
|
schema: "jellyfin");
|
|
|
|
|
|
2020-12-04 23:00:11 +00:00
|
|
|
|
migrationBuilder.DropIndex(
|
|
|
|
|
name: "IX_DisplayPreferences_UserId_ItemId_Client",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropColumn(
|
|
|
|
|
name: "ItemId",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences");
|
|
|
|
|
|
2020-12-03 20:51:12 +00:00
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
|
|
|
name: "MaxActiveSessions",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "Users",
|
|
|
|
|
type: "INTEGER",
|
|
|
|
|
nullable: true,
|
|
|
|
|
oldClrType: typeof(int),
|
|
|
|
|
oldType: "INTEGER");
|
2020-12-04 23:00:11 +00:00
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_DisplayPreferences_UserId_Client",
|
|
|
|
|
schema: "jellyfin",
|
|
|
|
|
table: "DisplayPreferences",
|
|
|
|
|
columns: new[] { "UserId", "Client" },
|
|
|
|
|
unique: true);
|
2020-12-03 20:51:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|