mirror of https://github.com/ErsatzTV/ErsatzTV.git
15 changed files with 14014 additions and 34 deletions
@ -1,9 +1,7 @@ |
|||||||
using ErsatzTV.Core.Domain; |
namespace ErsatzTV.Core.Interfaces.Repositories; |
||||||
|
|
||||||
namespace ErsatzTV.Core.Interfaces.Repositories; |
|
||||||
|
|
||||||
public interface IArtworkRepository |
public interface IArtworkRepository |
||||||
{ |
{ |
||||||
Task<List<Artwork>> GetOrphanedArtwork(); |
Task<List<int>> GetOrphanedArtworkIds(); |
||||||
Task<Unit> Delete(List<Artwork> artwork); |
Task<Unit> Delete(List<int> artworkIds); |
||||||
} |
} |
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.MySql.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Add_ArtworkIsMetadataOrphan : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.AddColumn<bool>( |
||||||
|
name: "IsMetadataOrphan", |
||||||
|
table: "Artwork", |
||||||
|
type: "tinyint(1)", |
||||||
|
nullable: true, |
||||||
|
computedColumnSql: "CASE WHEN COALESCE(ArtistMetadataId, ChannelId, EpisodeMetadataId, MovieMetadataId, MusicVideoMetadataId, OtherVideoMetadataId, SeasonMetadataId, ShowMetadataId, SongMetadataId, ImageMetadataId, RemoteStreamMetadataId) IS NULL THEN 1 ELSE NULL END", |
||||||
|
stored: false); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
name: "IX_Artwork_IsMetadataOrphan", |
||||||
|
table: "Artwork", |
||||||
|
column: "IsMetadataOrphan"); |
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.DropIndex( |
||||||
|
name: "IX_Artwork_IsMetadataOrphan", |
||||||
|
table: "Artwork"); |
||||||
|
|
||||||
|
migrationBuilder.DropColumn( |
||||||
|
name: "IsMetadataOrphan", |
||||||
|
table: "Artwork"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
#nullable disable |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Add_ArtworkIsMetadataOrphan : Migration |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.AddColumn<bool>( |
||||||
|
name: "IsMetadataOrphan", |
||||||
|
table: "Artwork", |
||||||
|
type: "INTEGER", |
||||||
|
nullable: true, |
||||||
|
computedColumnSql: "CASE WHEN COALESCE(ArtistMetadataId, ChannelId, EpisodeMetadataId, MovieMetadataId, MusicVideoMetadataId, OtherVideoMetadataId, SeasonMetadataId, ShowMetadataId, SongMetadataId, ImageMetadataId, RemoteStreamMetadataId) IS NULL THEN 1 ELSE NULL END", |
||||||
|
stored: false); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
name: "IX_Artwork_IsMetadataOrphan", |
||||||
|
table: "Artwork", |
||||||
|
column: "IsMetadataOrphan"); |
||||||
|
} |
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.DropIndex( |
||||||
|
name: "IX_Artwork_IsMetadataOrphan", |
||||||
|
table: "Artwork"); |
||||||
|
|
||||||
|
migrationBuilder.DropColumn( |
||||||
|
name: "IsMetadataOrphan", |
||||||
|
table: "Artwork"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue