Kavita/Kavita.Database/Migrations/20210916142418_EntityImageRefactor.cs
Fesaa c62b20f54b
BE Tech Debt (#4497)
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
2026-03-07 10:04:08 -08:00

98 lines
3.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Kavita.Database.Migrations
{
public partial class EntityImageRefactor : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RowVersion",
table: "AppUserProgresses");
migrationBuilder.AlterColumn<string>(
name: "CoverImage",
table: "Volume",
type: "TEXT",
nullable: true,
oldClrType: typeof(byte[]),
oldType: "BLOB",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CoverImage",
table: "Series",
type: "TEXT",
nullable: true,
oldClrType: typeof(byte[]),
oldType: "BLOB",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CoverImage",
table: "CollectionTag",
type: "TEXT",
nullable: true,
oldClrType: typeof(byte[]),
oldType: "BLOB",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CoverImage",
table: "Chapter",
type: "TEXT",
nullable: true,
oldClrType: typeof(byte[]),
oldType: "BLOB",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<byte[]>(
name: "CoverImage",
table: "Volume",
type: "BLOB",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<byte[]>(
name: "CoverImage",
table: "Series",
type: "BLOB",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<byte[]>(
name: "CoverImage",
table: "CollectionTag",
type: "BLOB",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<byte[]>(
name: "CoverImage",
table: "Chapter",
type: "BLOB",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AddColumn<uint>(
name: "RowVersion",
table: "AppUserProgresses",
type: "INTEGER",
nullable: false,
defaultValue: 0u);
}
}
}