mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
#nullable disable |
|
|
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
|
{ |
|
/// <inheritdoc /> |
|
public partial class Update_MediaFilePathHash : Migration |
|
{ |
|
/// <inheritdoc /> |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.AlterColumn<string>( |
|
name: "PathHash", |
|
table: "MediaFile", |
|
type: "TEXT", |
|
nullable: false, |
|
defaultValue: "", |
|
oldClrType: typeof(string), |
|
oldType: "TEXT", |
|
oldNullable: true); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_MediaFile_PathHash", |
|
table: "MediaFile", |
|
column: "PathHash", |
|
unique: true); |
|
} |
|
|
|
/// <inheritdoc /> |
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropIndex( |
|
name: "IX_MediaFile_PathHash", |
|
table: "MediaFile"); |
|
|
|
migrationBuilder.AlterColumn<string>( |
|
name: "PathHash", |
|
table: "MediaFile", |
|
type: "TEXT", |
|
nullable: true, |
|
oldClrType: typeof(string), |
|
oldType: "TEXT"); |
|
} |
|
} |
|
}
|
|
|