Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

1.5 KB
Raw Blame
using Microsoft.EntityFrameworkCore.Migrations;

namespace API.Data.Migrations
{
    public partial class AddedSeriesFormat : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Series_Name_NormalizedName_LocalizedName_LibraryId",
                table: "Series");

            migrationBuilder.AddColumn<int>(
                name: "Format",
                table: "Series",
                type: "INTEGER",
                nullable: false,
                defaultValue: 2);

            migrationBuilder.CreateIndex(
                name: "IX_Series_Name_NormalizedName_LocalizedName_LibraryId_Format",
                table: "Series",
                columns: new[] { "Name", "NormalizedName", "LocalizedName", "LibraryId", "Format" },
                unique: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Series_Name_NormalizedName_LocalizedName_LibraryId_Format",
                table: "Series");

            migrationBuilder.DropColumn(
                name: "Format",
                table: "Series");

            migrationBuilder.CreateIndex(
                name: "IX_Series_Name_NormalizedName_LocalizedName_LibraryId",
                table: "Series",
                columns: new[] { "Name", "NormalizedName", "LocalizedName", "LibraryId" },
                unique: true);
        }
    }
}