mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* refactor sqlite into separate library * support mysql * fixes * sql fixes * cleanup * update changelogpull/1376/head
1008 changed files with 743873 additions and 726122 deletions
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net7.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<Folder Include="Migrations\" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<ProjectReference Include="..\ErsatzTV.Core\ErsatzTV.Core.csproj" /> |
||||
<ProjectReference Include="..\ErsatzTV.Infrastructure\ErsatzTV.Infrastructure.csproj" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.10" /> |
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
namespace ErsatzTV.Infrastructure.MySql; |
||||
|
||||
public abstract class Marker {} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace ErsatzTV.Infrastructure.MySql.Migrations |
||||
{ |
||||
/// <inheritdoc />
|
||||
public partial class InitialData : Migration |
||||
{ |
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.Sql("INSERT INTO MediaSource VALUES (NULL)"); |
||||
migrationBuilder.Sql("INSERT INTO LocalMediaSource (Id) SELECT last_insert_id()"); |
||||
|
||||
// create local movies library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Movies', 1, Id FROM LocalMediaSource");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_id())"); |
||||
|
||||
// create local shows library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Shows', 2, Id FROM LocalMediaSource");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_id())"); |
||||
|
||||
// create local music videos library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Music Videos', 3, Id FROM |
||||
(SELECT LMS.Id FROM LocalMediaSource LMS |
||||
INNER JOIN Library L on L.MediaSourceId = LMS.Id |
||||
INNER JOIN LocalLibrary LL on L.Id = LL.Id |
||||
WHERE L.Name = 'Movies') AS A");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_id())"); |
||||
|
||||
migrationBuilder.Sql( |
||||
"INSERT INTO ConfigElement (`Key`, Value) VALUES ('scanner.library_refresh_interval', '6')"); |
||||
|
||||
// create local other videos library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Other Videos', 4, Id FROM |
||||
(SELECT LMS.Id FROM LocalMediaSource LMS LIMIT 1) AS A");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_id())"); |
||||
|
||||
// create local songs library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Songs', 5, Id FROM |
||||
(SELECT LMS.Id FROM LocalMediaSource LMS LIMIT 1) AS A");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_id())"); |
||||
|
||||
migrationBuilder.Sql("INSERT INTO Resolution (Id, Height, Width, Name) VALUES (0, 480, 640, '640x480')"); |
||||
} |
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
using System.Data; |
||||
using Dapper; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Data; |
||||
|
||||
public abstract class SqliteTypeHandler<T> : SqlMapper.TypeHandler<T> |
||||
{ |
||||
// Parameters are converted by Microsoft.Data.Sqlite
|
||||
public override void SetValue(IDbDataParameter parameter, T value) |
||||
=> parameter.Value = value; |
||||
} |
||||
|
||||
public class DateTimeOffsetHandler : SqliteTypeHandler<DateTimeOffset> |
||||
{ |
||||
public override DateTimeOffset Parse(object value) |
||||
=> DateTimeOffset.Parse((string)value); |
||||
} |
||||
|
||||
public class GuidHandler : SqliteTypeHandler<Guid> |
||||
{ |
||||
public override Guid Parse(object value) |
||||
=> Guid.Parse((string)value); |
||||
} |
||||
|
||||
public class TimeSpanHandler : SqliteTypeHandler<TimeSpan> |
||||
{ |
||||
public override TimeSpan Parse(object value) |
||||
=> TimeSpan.Parse((string)value); |
||||
} |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net7.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<ProjectReference Include="..\ErsatzTV.Core\ErsatzTV.Core.csproj" /> |
||||
<ProjectReference Include="..\ErsatzTV.Infrastructure\ErsatzTV.Infrastructure.csproj" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Dapper" Version="2.0.143" /> |
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.10" /> |
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" /> |
||||
</ItemGroup> |
||||
|
||||
|
||||
|
||||
</Project> |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
namespace ErsatzTV.Infrastructure.Sqlite; |
||||
|
||||
public abstract class Marker {} |
@ -0,0 +1,877 @@
@@ -0,0 +1,877 @@
|
||||
// <auto-generated />
|
||||
using System; |
||||
using ErsatzTV.Infrastructure.Data; |
||||
using ErsatzTV.Infrastructure.Sqlite.Data; |
||||
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
[DbContext(typeof(TvContext))] |
||||
[Migration("20210212105010_Initial")] |
||||
partial class Initial |
||||
{ |
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
{ |
||||
#pragma warning disable 612, 618
|
||||
modelBuilder |
||||
.HasAnnotation("ProductVersion", "5.0.3"); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.GenericIntegerId", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("GenericIntegerIds"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaCollectionSummary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsSimple") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ItemCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("MediaCollectionSummaries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("FFmpegProfileId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Logo") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Number") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("StreamingMode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<Guid>("UniqueId") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("FFmpegProfileId"); |
||||
|
||||
b.HasIndex("Number") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("Channels"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Value") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Key") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ConfigElements"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioChannels") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("AudioSampleRate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioVolume") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<bool>("NormalizeAudio") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeAudioCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeResolution") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeVideoCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ResolutionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ThreadCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("Transcode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ResolutionId"); |
||||
|
||||
b.ToTable("FFmpegProfiles"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaCollection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTime?>("LastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Path") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaSourceId"); |
||||
|
||||
b.ToTable("MediaItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("SourceType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ChannelId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramSchedulePlayoutType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ChannelId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Finish") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Start") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaItemId"); |
||||
|
||||
b.HasIndex("PlayoutId"); |
||||
|
||||
b.ToTable("PlayoutItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("PlayoutId", "ProgramScheduleId", "MediaCollectionId"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsActive") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Uri") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceConnections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceLibraries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionPlaybackOrder") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ProgramSchedules"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan?>("StartTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("ProgramScheduleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.ToTable("Resolutions"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.Property<int>("ItemsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("SimpleMediaCollectionsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("ItemsId", "SimpleMediaCollectionsId"); |
||||
|
||||
b.HasIndex("SimpleMediaCollectionsId"); |
||||
|
||||
b.ToTable("MediaItemSimpleMediaCollection"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.ToTable("SimpleMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("ShowTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasIndex("ShowTitle", "SeasonNumber") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("TelevisionMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("Folder") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("LocalMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("ClientIdentifier") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("ProductVersion") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("PlexMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<bool>("OfflineTail") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan>("PlayoutDuration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("ProgramScheduleDurationItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleFloodItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<int>("Count") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("ProgramScheduleMultipleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleOneItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile") |
||||
.WithMany() |
||||
.HasForeignKey("FFmpegProfileId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("FFmpegProfile"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution") |
||||
.WithMany() |
||||
.HasForeignKey("ResolutionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("Resolution"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", "Source") |
||||
.WithMany() |
||||
.HasForeignKey("MediaSourceId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaMetadata", "Metadata", b1 => |
||||
{ |
||||
b1.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTime?>("Aired") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("ContentRating") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Description") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("DisplayAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<TimeSpan>("Duration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("EpisodeNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SampleAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("VideoScanType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("MediaItemId"); |
||||
|
||||
b1.ToTable("MediaItems"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("MediaItemId"); |
||||
}); |
||||
|
||||
b.Navigation("Metadata"); |
||||
|
||||
b.Navigation("Source"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ChannelId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("NextScheduleItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTimeOffset>("NextStart") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.HasKey("PlayoutId"); |
||||
|
||||
b1.HasIndex("NextScheduleItemId"); |
||||
|
||||
b1.ToTable("Playouts"); |
||||
|
||||
b1.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "NextScheduleItem") |
||||
.WithMany() |
||||
.HasForeignKey("NextScheduleItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutId"); |
||||
|
||||
b1.Navigation("NextScheduleItem"); |
||||
}); |
||||
|
||||
b.Navigation("Anchor"); |
||||
|
||||
b.Navigation("Channel"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem") |
||||
.WithMany() |
||||
.HasForeignKey("MediaItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("Items") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaItem"); |
||||
|
||||
b.Navigation("Playout"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("ProgramScheduleAnchors") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany() |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaCollectionEnumeratorState", "EnumeratorState", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutProgramScheduleAnchorPlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorMediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Seed") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
|
||||
b1.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
}); |
||||
|
||||
b.Navigation("EnumeratorState"); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("Playout"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Connections") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Libraries") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Items") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) |
||||
.WithMany() |
||||
.HasForeignKey("ItemsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.SimpleMediaCollection", null) |
||||
.WithMany() |
||||
.HasForeignKey("SimpleMediaCollectionsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.SimpleMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.TelevisionMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.LocalMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.PlexMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemOne", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("ProgramScheduleAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.Navigation("Connections"); |
||||
|
||||
b.Navigation("Libraries"); |
||||
}); |
||||
#pragma warning restore 612, 618
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,718 @@
@@ -0,0 +1,718 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Initial : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.CreateTable( |
||||
"ConfigElements", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
Value = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_ConfigElements", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"GenericIntegerIds", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaCollections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_MediaCollections", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaCollectionSummaries", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
ItemCount = table.Column<int>("INTEGER", nullable: false), |
||||
IsSimple = table.Column<bool>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaSources", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
SourceType = table.Column<int>("INTEGER", nullable: false), |
||||
Name = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_MediaSources", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramSchedules", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
MediaCollectionPlaybackOrder = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_ProgramSchedules", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Resolutions", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
Height = table.Column<int>("INTEGER", nullable: false), |
||||
Width = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_Resolutions", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_SimpleMediaCollections", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollections_MediaCollections_Id", |
||||
x => x.Id, |
||||
"MediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionMediaCollections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
ShowTitle = table.Column<string>("TEXT", nullable: true), |
||||
SeasonNumber = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionMediaCollections", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionMediaCollections_MediaCollections_Id", |
||||
x => x.Id, |
||||
"MediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"LocalMediaSources", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
MediaType = table.Column<int>("INTEGER", nullable: false), |
||||
Folder = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_LocalMediaSources", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_LocalMediaSources_MediaSources_Id", |
||||
x => x.Id, |
||||
"MediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
MediaSourceId = table.Column<int>("INTEGER", nullable: false), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_Duration = table.Column<TimeSpan>("TEXT", nullable: true), |
||||
Metadata_SampleAspectRatio = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_DisplayAspectRatio = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_VideoCodec = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_AudioCodec = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_MediaType = table.Column<int>("INTEGER", nullable: true), |
||||
Metadata_Title = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_Subtitle = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_Description = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_SeasonNumber = table.Column<int>("INTEGER", nullable: true), |
||||
Metadata_EpisodeNumber = table.Column<int>("INTEGER", nullable: true), |
||||
Metadata_ContentRating = table.Column<string>("TEXT", nullable: true), |
||||
Metadata_Aired = table.Column<DateTime>("TEXT", nullable: true), |
||||
Metadata_VideoScanType = table.Column<int>("INTEGER", nullable: true), |
||||
Metadata_Width = table.Column<int>("INTEGER", nullable: true), |
||||
Metadata_Height = table.Column<int>("INTEGER", nullable: true), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MediaItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_MediaItems_MediaSources_MediaSourceId", |
||||
x => x.MediaSourceId, |
||||
"MediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaSources", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
ProductVersion = table.Column<string>("TEXT", nullable: true), |
||||
ClientIdentifier = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMediaSources", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMediaSources_MediaSources_Id", |
||||
x => x.Id, |
||||
"MediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramScheduleItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Index = table.Column<int>("INTEGER", nullable: false), |
||||
StartTime = table.Column<TimeSpan>("TEXT", nullable: true), |
||||
MediaCollectionId = table.Column<int>("INTEGER", nullable: false), |
||||
ProgramScheduleId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ProgramScheduleItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleItems_MediaCollections_MediaCollectionId", |
||||
x => x.MediaCollectionId, |
||||
"MediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleItems_ProgramSchedules_ProgramScheduleId", |
||||
x => x.ProgramScheduleId, |
||||
"ProgramSchedules", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"FFmpegProfiles", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
ThreadCount = table.Column<int>("INTEGER", nullable: false), |
||||
Transcode = table.Column<bool>("INTEGER", nullable: false), |
||||
ResolutionId = table.Column<int>("INTEGER", nullable: false), |
||||
NormalizeResolution = table.Column<bool>("INTEGER", nullable: false), |
||||
VideoCodec = table.Column<string>("TEXT", nullable: true), |
||||
NormalizeVideoCodec = table.Column<bool>("INTEGER", nullable: false), |
||||
VideoBitrate = table.Column<int>("INTEGER", nullable: false), |
||||
VideoBufferSize = table.Column<int>("INTEGER", nullable: false), |
||||
AudioCodec = table.Column<string>("TEXT", nullable: true), |
||||
NormalizeAudioCodec = table.Column<bool>("INTEGER", nullable: false), |
||||
AudioBitrate = table.Column<int>("INTEGER", nullable: false), |
||||
AudioBufferSize = table.Column<int>("INTEGER", nullable: false), |
||||
AudioVolume = table.Column<int>("INTEGER", nullable: false), |
||||
AudioChannels = table.Column<int>("INTEGER", nullable: false), |
||||
AudioSampleRate = table.Column<int>("INTEGER", nullable: false), |
||||
NormalizeAudio = table.Column<bool>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_FFmpegProfiles", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_FFmpegProfiles_Resolutions_ResolutionId", |
||||
x => x.ResolutionId, |
||||
"Resolutions", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaItemSimpleMediaCollection", |
||||
table => new |
||||
{ |
||||
ItemsId = table.Column<int>("INTEGER", nullable: false), |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_MediaItemSimpleMediaCollection", |
||||
x => new { x.ItemsId, x.SimpleMediaCollectionsId }); |
||||
table.ForeignKey( |
||||
"FK_MediaItemSimpleMediaCollection_MediaItems_ItemsId", |
||||
x => x.ItemsId, |
||||
"MediaItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_MediaItemSimpleMediaCollection_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaSourceConnections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
IsActive = table.Column<bool>("INTEGER", nullable: false), |
||||
Uri = table.Column<string>("TEXT", nullable: true), |
||||
PlexMediaSourceId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMediaSourceConnections", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMediaSourceConnections_PlexMediaSources_PlexMediaSourceId", |
||||
x => x.PlexMediaSourceId, |
||||
"PlexMediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaSourceLibraries", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
MediaType = table.Column<int>("INTEGER", nullable: false), |
||||
PlexMediaSourceId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMediaSourceLibraries", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMediaSourceLibraries_PlexMediaSources_PlexMediaSourceId", |
||||
x => x.PlexMediaSourceId, |
||||
"PlexMediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramScheduleDurationItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
PlayoutDuration = table.Column<TimeSpan>("TEXT", nullable: false), |
||||
OfflineTail = table.Column<bool>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ProgramScheduleDurationItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleDurationItems_ProgramScheduleItems_Id", |
||||
x => x.Id, |
||||
"ProgramScheduleItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramScheduleFloodItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ProgramScheduleFloodItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleFloodItems_ProgramScheduleItems_Id", |
||||
x => x.Id, |
||||
"ProgramScheduleItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramScheduleMultipleItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Count = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ProgramScheduleMultipleItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleMultipleItems_ProgramScheduleItems_Id", |
||||
x => x.Id, |
||||
"ProgramScheduleItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ProgramScheduleOneItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ProgramScheduleOneItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ProgramScheduleOneItems_ProgramScheduleItems_Id", |
||||
x => x.Id, |
||||
"ProgramScheduleItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Channels", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
UniqueId = table.Column<Guid>("TEXT", nullable: false), |
||||
Number = table.Column<int>("INTEGER", nullable: false), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
Logo = table.Column<string>("TEXT", nullable: true), |
||||
FFmpegProfileId = table.Column<int>("INTEGER", nullable: false), |
||||
StreamingMode = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Channels", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Channels_FFmpegProfiles_FFmpegProfileId", |
||||
x => x.FFmpegProfileId, |
||||
"FFmpegProfiles", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Playouts", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
ChannelId = table.Column<int>("INTEGER", nullable: false), |
||||
ProgramScheduleId = table.Column<int>("INTEGER", nullable: false), |
||||
ProgramSchedulePlayoutType = table.Column<int>("INTEGER", nullable: false), |
||||
Anchor_NextScheduleItemId = table.Column<int>("INTEGER", nullable: true), |
||||
Anchor_NextStart = table.Column<DateTimeOffset>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Playouts", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Playouts_Channels_ChannelId", |
||||
x => x.ChannelId, |
||||
"Channels", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Playouts_ProgramScheduleItems_Anchor_NextScheduleItemId", |
||||
x => x.Anchor_NextScheduleItemId, |
||||
"ProgramScheduleItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Playouts_ProgramSchedules_ProgramScheduleId", |
||||
x => x.ProgramScheduleId, |
||||
"ProgramSchedules", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlayoutItems", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
MediaItemId = table.Column<int>("INTEGER", nullable: false), |
||||
Start = table.Column<DateTimeOffset>("TEXT", nullable: false), |
||||
Finish = table.Column<DateTimeOffset>("TEXT", nullable: false), |
||||
PlayoutId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlayoutItems", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlayoutItems_MediaItems_MediaItemId", |
||||
x => x.MediaItemId, |
||||
"MediaItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_PlayoutItems_Playouts_PlayoutId", |
||||
x => x.PlayoutId, |
||||
"Playouts", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
table => new |
||||
{ |
||||
PlayoutId = table.Column<int>("INTEGER", nullable: false), |
||||
ProgramScheduleId = table.Column<int>("INTEGER", nullable: false), |
||||
MediaCollectionId = table.Column<int>("INTEGER", nullable: false), |
||||
EnumeratorState_Seed = table.Column<int>("INTEGER", nullable: true), |
||||
EnumeratorState_Index = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_PlayoutProgramScheduleItemAnchors", |
||||
x => new { x.PlayoutId, x.ProgramScheduleId, x.MediaCollectionId }); |
||||
table.ForeignKey( |
||||
"FK_PlayoutProgramScheduleItemAnchors_MediaCollections_MediaCollectionId", |
||||
x => x.MediaCollectionId, |
||||
"MediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_PlayoutProgramScheduleItemAnchors_Playouts_PlayoutId", |
||||
x => x.PlayoutId, |
||||
"Playouts", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_PlayoutProgramScheduleItemAnchors_ProgramSchedules_ProgramScheduleId", |
||||
x => x.ProgramScheduleId, |
||||
"ProgramSchedules", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Channels_FFmpegProfileId", |
||||
"Channels", |
||||
"FFmpegProfileId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Channels_Number", |
||||
"Channels", |
||||
"Number", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ConfigElements_Key", |
||||
"ConfigElements", |
||||
"Key", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_FFmpegProfiles_ResolutionId", |
||||
"FFmpegProfiles", |
||||
"ResolutionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaCollections_Name", |
||||
"MediaCollections", |
||||
"Name", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItems_MediaSourceId", |
||||
"MediaItems", |
||||
"MediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItemSimpleMediaCollection_SimpleMediaCollectionsId", |
||||
"MediaItemSimpleMediaCollection", |
||||
"SimpleMediaCollectionsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaSources_Name", |
||||
"MediaSources", |
||||
"Name", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutItems_MediaItemId", |
||||
"PlayoutItems", |
||||
"MediaItemId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutItems_PlayoutId", |
||||
"PlayoutItems", |
||||
"PlayoutId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"MediaCollectionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_ProgramScheduleId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"ProgramScheduleId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Playouts_Anchor_NextScheduleItemId", |
||||
"Playouts", |
||||
"Anchor_NextScheduleItemId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Playouts_ChannelId", |
||||
"Playouts", |
||||
"ChannelId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Playouts_ProgramScheduleId", |
||||
"Playouts", |
||||
"ProgramScheduleId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexMediaSourceConnections_PlexMediaSourceId", |
||||
"PlexMediaSourceConnections", |
||||
"PlexMediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexMediaSourceLibraries_PlexMediaSourceId", |
||||
"PlexMediaSourceLibraries", |
||||
"PlexMediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItems_MediaCollectionId", |
||||
"ProgramScheduleItems", |
||||
"MediaCollectionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItems_ProgramScheduleId", |
||||
"ProgramScheduleItems", |
||||
"ProgramScheduleId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramSchedules_Name", |
||||
"ProgramSchedules", |
||||
"Name", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionMediaCollections_ShowTitle_SeasonNumber", |
||||
"TelevisionMediaCollections", |
||||
new[] { "ShowTitle", "SeasonNumber" }, |
||||
unique: true); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"ConfigElements"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"GenericIntegerIds"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"LocalMediaSources"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaCollectionSummaries"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaItemSimpleMediaCollection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlayoutItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaSourceConnections"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaSourceLibraries"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramScheduleDurationItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramScheduleFloodItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramScheduleMultipleItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramScheduleOneItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionMediaCollections"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollections"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Playouts"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaSources"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Channels"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaSources"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"FFmpegProfiles"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaCollections"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ProgramSchedules"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Resolutions"); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,880 @@
@@ -0,0 +1,880 @@
|
||||
// <auto-generated />
|
||||
using System; |
||||
using ErsatzTV.Infrastructure.Data; |
||||
using ErsatzTV.Infrastructure.Sqlite.Data; |
||||
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
[DbContext(typeof(TvContext))] |
||||
[Migration("20210213155419_MetadataSortTitle")] |
||||
partial class MetadataSortTitle |
||||
{ |
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
{ |
||||
#pragma warning disable 612, 618
|
||||
modelBuilder |
||||
.HasAnnotation("ProductVersion", "5.0.3"); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.GenericIntegerId", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("GenericIntegerIds"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaCollectionSummary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsSimple") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ItemCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("MediaCollectionSummaries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("FFmpegProfileId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Logo") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Number") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("StreamingMode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<Guid>("UniqueId") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("FFmpegProfileId"); |
||||
|
||||
b.HasIndex("Number") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("Channels"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Value") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Key") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ConfigElements"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioChannels") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("AudioSampleRate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioVolume") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<bool>("NormalizeAudio") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeAudioCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeResolution") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeVideoCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ResolutionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ThreadCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("Transcode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ResolutionId"); |
||||
|
||||
b.ToTable("FFmpegProfiles"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaCollection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTime?>("LastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Path") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaSourceId"); |
||||
|
||||
b.ToTable("MediaItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("SourceType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ChannelId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramSchedulePlayoutType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ChannelId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Finish") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Start") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaItemId"); |
||||
|
||||
b.HasIndex("PlayoutId"); |
||||
|
||||
b.ToTable("PlayoutItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("PlayoutId", "ProgramScheduleId", "MediaCollectionId"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsActive") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Uri") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceConnections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceLibraries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionPlaybackOrder") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ProgramSchedules"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan?>("StartTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("ProgramScheduleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.ToTable("Resolutions"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.Property<int>("ItemsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("SimpleMediaCollectionsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("ItemsId", "SimpleMediaCollectionsId"); |
||||
|
||||
b.HasIndex("SimpleMediaCollectionsId"); |
||||
|
||||
b.ToTable("MediaItemSimpleMediaCollection"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.ToTable("SimpleMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("ShowTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasIndex("ShowTitle", "SeasonNumber") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("TelevisionMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("Folder") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("LocalMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("ClientIdentifier") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("ProductVersion") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("PlexMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<bool>("OfflineTail") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan>("PlayoutDuration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("ProgramScheduleDurationItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleFloodItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<int>("Count") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("ProgramScheduleMultipleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleOneItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile") |
||||
.WithMany() |
||||
.HasForeignKey("FFmpegProfileId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("FFmpegProfile"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution") |
||||
.WithMany() |
||||
.HasForeignKey("ResolutionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("Resolution"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", "Source") |
||||
.WithMany() |
||||
.HasForeignKey("MediaSourceId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaMetadata", "Metadata", b1 => |
||||
{ |
||||
b1.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTime?>("Aired") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("ContentRating") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Description") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("DisplayAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<TimeSpan>("Duration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("EpisodeNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SampleAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SortTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("VideoScanType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("MediaItemId"); |
||||
|
||||
b1.ToTable("MediaItems"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("MediaItemId"); |
||||
}); |
||||
|
||||
b.Navigation("Metadata"); |
||||
|
||||
b.Navigation("Source"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ChannelId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("NextScheduleItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTimeOffset>("NextStart") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.HasKey("PlayoutId"); |
||||
|
||||
b1.HasIndex("NextScheduleItemId"); |
||||
|
||||
b1.ToTable("Playouts"); |
||||
|
||||
b1.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "NextScheduleItem") |
||||
.WithMany() |
||||
.HasForeignKey("NextScheduleItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutId"); |
||||
|
||||
b1.Navigation("NextScheduleItem"); |
||||
}); |
||||
|
||||
b.Navigation("Anchor"); |
||||
|
||||
b.Navigation("Channel"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem") |
||||
.WithMany() |
||||
.HasForeignKey("MediaItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("Items") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaItem"); |
||||
|
||||
b.Navigation("Playout"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("ProgramScheduleAnchors") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany() |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaCollectionEnumeratorState", "EnumeratorState", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutProgramScheduleAnchorPlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorMediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Seed") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
|
||||
b1.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
}); |
||||
|
||||
b.Navigation("EnumeratorState"); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("Playout"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Connections") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Libraries") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Items") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) |
||||
.WithMany() |
||||
.HasForeignKey("ItemsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.SimpleMediaCollection", null) |
||||
.WithMany() |
||||
.HasForeignKey("SimpleMediaCollectionsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.SimpleMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.TelevisionMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.LocalMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.PlexMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemOne", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("ProgramScheduleAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.Navigation("Connections"); |
||||
|
||||
b.Navigation("Libraries"); |
||||
}); |
||||
#pragma warning restore 612, 618
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class MetadataSortTitle : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_SortTitle", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE MediaItems
|
||||
SET Metadata_SortTitle = Metadata_Title");
|
||||
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE MediaItems
|
||||
SET Metadata_SortTitle = substr(Metadata_Title, 5) |
||||
WHERE Metadata_Title LIKE 'the %'");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.DropColumn( |
||||
"Metadata_SortTitle", |
||||
"MediaItems"); |
||||
} |
||||
} |
@ -0,0 +1,894 @@
@@ -0,0 +1,894 @@
|
||||
// <auto-generated />
|
||||
using System; |
||||
using ErsatzTV.Infrastructure.Data; |
||||
using ErsatzTV.Infrastructure.Sqlite.Data; |
||||
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
[DbContext(typeof(TvContext))] |
||||
[Migration("20210213221040_MediaItemPoster")] |
||||
partial class MediaItemPoster |
||||
{ |
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
{ |
||||
#pragma warning disable 612, 618
|
||||
modelBuilder |
||||
.HasAnnotation("ProductVersion", "5.0.3"); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.GenericIntegerId", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaCollectionSummary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsSimple") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ItemCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaItemSummary", b => |
||||
{ |
||||
b.Property<string>("Poster") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("SortTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("FFmpegProfileId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Logo") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Number") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("StreamingMode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<Guid>("UniqueId") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("FFmpegProfileId"); |
||||
|
||||
b.HasIndex("Number") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("Channels"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Value") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Key") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ConfigElements"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioChannels") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("AudioSampleRate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioVolume") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<bool>("NormalizeAudio") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeAudioCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeResolution") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeVideoCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ResolutionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ThreadCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("Transcode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ResolutionId"); |
||||
|
||||
b.ToTable("FFmpegProfiles"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaCollection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTime?>("LastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Path") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Poster") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaSourceId"); |
||||
|
||||
b.ToTable("MediaItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("SourceType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ChannelId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramSchedulePlayoutType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ChannelId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Finish") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Start") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaItemId"); |
||||
|
||||
b.HasIndex("PlayoutId"); |
||||
|
||||
b.ToTable("PlayoutItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("PlayoutId", "ProgramScheduleId", "MediaCollectionId"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsActive") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Uri") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceConnections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceLibraries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionPlaybackOrder") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ProgramSchedules"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan?>("StartTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("ProgramScheduleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.ToTable("Resolutions"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.Property<int>("ItemsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("SimpleMediaCollectionsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("ItemsId", "SimpleMediaCollectionsId"); |
||||
|
||||
b.HasIndex("SimpleMediaCollectionsId"); |
||||
|
||||
b.ToTable("MediaItemSimpleMediaCollection"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.ToTable("SimpleMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("ShowTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasIndex("ShowTitle", "SeasonNumber") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("TelevisionMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("Folder") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("LocalMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("ClientIdentifier") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("ProductVersion") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("PlexMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<bool>("OfflineTail") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan>("PlayoutDuration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("ProgramScheduleDurationItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleFloodItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<int>("Count") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("ProgramScheduleMultipleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleOneItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile") |
||||
.WithMany() |
||||
.HasForeignKey("FFmpegProfileId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("FFmpegProfile"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution") |
||||
.WithMany() |
||||
.HasForeignKey("ResolutionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("Resolution"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", "Source") |
||||
.WithMany() |
||||
.HasForeignKey("MediaSourceId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaMetadata", "Metadata", b1 => |
||||
{ |
||||
b1.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTime?>("Aired") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("ContentRating") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Description") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("DisplayAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<TimeSpan>("Duration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("EpisodeNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SampleAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SortTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("VideoScanType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("MediaItemId"); |
||||
|
||||
b1.ToTable("MediaItems"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("MediaItemId"); |
||||
}); |
||||
|
||||
b.Navigation("Metadata"); |
||||
|
||||
b.Navigation("Source"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ChannelId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("NextScheduleItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTimeOffset>("NextStart") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.HasKey("PlayoutId"); |
||||
|
||||
b1.HasIndex("NextScheduleItemId"); |
||||
|
||||
b1.ToTable("Playouts"); |
||||
|
||||
b1.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "NextScheduleItem") |
||||
.WithMany() |
||||
.HasForeignKey("NextScheduleItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutId"); |
||||
|
||||
b1.Navigation("NextScheduleItem"); |
||||
}); |
||||
|
||||
b.Navigation("Anchor"); |
||||
|
||||
b.Navigation("Channel"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem") |
||||
.WithMany() |
||||
.HasForeignKey("MediaItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("Items") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaItem"); |
||||
|
||||
b.Navigation("Playout"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("ProgramScheduleAnchors") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany() |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaCollectionEnumeratorState", "EnumeratorState", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutProgramScheduleAnchorPlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorMediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Seed") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
|
||||
b1.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
}); |
||||
|
||||
b.Navigation("EnumeratorState"); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("Playout"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Connections") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Libraries") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Items") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) |
||||
.WithMany() |
||||
.HasForeignKey("ItemsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.SimpleMediaCollection", null) |
||||
.WithMany() |
||||
.HasForeignKey("SimpleMediaCollectionsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.SimpleMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.TelevisionMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.LocalMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.PlexMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemOne", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("ProgramScheduleAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.Navigation("Connections"); |
||||
|
||||
b.Navigation("Libraries"); |
||||
}); |
||||
#pragma warning restore 612, 618
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class MediaItemPoster : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"GenericIntegerIds"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaCollectionSummaries"); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Poster", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"Poster", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"GenericIntegerIds", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaCollectionSummaries", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false), |
||||
IsSimple = table.Column<bool>("INTEGER", nullable: false), |
||||
ItemCount = table.Column<int>("INTEGER", nullable: false), |
||||
Name = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { }); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,906 @@
@@ -0,0 +1,906 @@
|
||||
// <auto-generated />
|
||||
using System; |
||||
using ErsatzTV.Infrastructure.Data; |
||||
using ErsatzTV.Infrastructure.Sqlite.Data; |
||||
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
[DbContext(typeof(TvContext))] |
||||
[Migration("20210215153541_MetadataOptimizations")] |
||||
partial class MetadataOptimizations |
||||
{ |
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
{ |
||||
#pragma warning disable 612, 618
|
||||
modelBuilder |
||||
.HasAnnotation("ProductVersion", "5.0.3"); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.GenericIntegerId", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaCollectionSummary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsSimple") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ItemCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.AggregateModels.MediaItemSummary", b => |
||||
{ |
||||
b.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Poster") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("SortTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("FFmpegProfileId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Logo") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Number") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("StreamingMode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<Guid>("UniqueId") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("FFmpegProfileId"); |
||||
|
||||
b.HasIndex("Number") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("Channels"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Value") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Key") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ConfigElements"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioChannels") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("AudioSampleRate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("AudioVolume") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<bool>("NormalizeAudio") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeAudioCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeResolution") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("NormalizeVideoCodec") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ResolutionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ThreadCount") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("Transcode") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBitrate") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("VideoBufferSize") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ResolutionId"); |
||||
|
||||
b.ToTable("FFmpegProfiles"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaCollection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTime?>("LastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Path") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("Poster") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<DateTime?>("PosterLastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaSourceId"); |
||||
|
||||
b.ToTable("MediaItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("SourceType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("MediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ChannelId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramSchedulePlayoutType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("ChannelId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Finish") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<DateTimeOffset>("Start") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaItemId"); |
||||
|
||||
b.HasIndex("PlayoutId"); |
||||
|
||||
b.ToTable("PlayoutItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("PlayoutId", "ProgramScheduleId", "MediaCollectionId"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<bool>("IsActive") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Uri") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceConnections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Key") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int?>("PlexMediaSourceId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("PlexMediaSourceId"); |
||||
|
||||
b.ToTable("PlexMediaSourceLibraries"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionPlaybackOrder") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("Name") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("ProgramSchedules"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("MediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("ProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan?>("StartTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.HasIndex("MediaCollectionId"); |
||||
|
||||
b.HasIndex("ProgramScheduleId"); |
||||
|
||||
b.ToTable("ProgramScheduleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b => |
||||
{ |
||||
b.Property<int>("Id") |
||||
.ValueGeneratedOnAdd() |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("Name") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("Id"); |
||||
|
||||
b.ToTable("Resolutions"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.Property<int>("ItemsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<int>("SimpleMediaCollectionsId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.HasKey("ItemsId", "SimpleMediaCollectionsId"); |
||||
|
||||
b.HasIndex("SimpleMediaCollectionsId"); |
||||
|
||||
b.ToTable("MediaItemSimpleMediaCollection"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.ToTable("SimpleMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaCollection"); |
||||
|
||||
b.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<string>("ShowTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.HasIndex("ShowTitle", "SeasonNumber") |
||||
.IsUnique(); |
||||
|
||||
b.ToTable("TelevisionMediaCollections"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("Folder") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("LocalMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource"); |
||||
|
||||
b.Property<string>("ClientIdentifier") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.Property<string>("ProductVersion") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("PlexMediaSources"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<bool>("OfflineTail") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.Property<TimeSpan>("PlayoutDuration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b.ToTable("ProgramScheduleDurationItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleFloodItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.Property<int>("Count") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b.ToTable("ProgramScheduleMultipleItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem"); |
||||
|
||||
b.ToTable("ProgramScheduleOneItems"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile") |
||||
.WithMany() |
||||
.HasForeignKey("FFmpegProfileId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("FFmpegProfile"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution") |
||||
.WithMany() |
||||
.HasForeignKey("ResolutionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("Resolution"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", "Source") |
||||
.WithMany() |
||||
.HasForeignKey("MediaSourceId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaMetadata", "Metadata", b1 => |
||||
{ |
||||
b1.Property<int>("MediaItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTime?>("Aired") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("AudioCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("ContentRating") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Description") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("DisplayAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<TimeSpan>("Duration") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("EpisodeNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Height") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTime?>("LastWriteTime") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("MediaType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SampleAspectRatio") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int?>("SeasonNumber") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("SortTitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("Source") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<string>("Subtitle") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("Title") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<string>("VideoCodec") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.Property<int>("VideoScanType") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Width") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("MediaItemId"); |
||||
|
||||
b1.ToTable("MediaItems"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("MediaItemId"); |
||||
}); |
||||
|
||||
b.Navigation("Metadata"); |
||||
|
||||
b.Navigation("Source"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ChannelId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Playouts") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("NextScheduleItemId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<DateTimeOffset>("NextStart") |
||||
.HasColumnType("TEXT"); |
||||
|
||||
b1.HasKey("PlayoutId"); |
||||
|
||||
b1.HasIndex("NextScheduleItemId"); |
||||
|
||||
b1.ToTable("Playouts"); |
||||
|
||||
b1.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "NextScheduleItem") |
||||
.WithMany() |
||||
.HasForeignKey("NextScheduleItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutId"); |
||||
|
||||
b1.Navigation("NextScheduleItem"); |
||||
}); |
||||
|
||||
b.Navigation("Anchor"); |
||||
|
||||
b.Navigation("Channel"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem") |
||||
.WithMany() |
||||
.HasForeignKey("MediaItemId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("Items") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaItem"); |
||||
|
||||
b.Navigation("Playout"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout") |
||||
.WithMany("ProgramScheduleAnchors") |
||||
.HasForeignKey("PlayoutId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany() |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.OwnsOne("ErsatzTV.Core.Domain.MediaCollectionEnumeratorState", "EnumeratorState", b1 => |
||||
{ |
||||
b1.Property<int>("PlayoutProgramScheduleAnchorPlayoutId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorProgramScheduleId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("PlayoutProgramScheduleAnchorMediaCollectionId") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Index") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.Property<int>("Seed") |
||||
.HasColumnType("INTEGER"); |
||||
|
||||
b1.HasKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
|
||||
b1.ToTable("PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
b1.WithOwner() |
||||
.HasForeignKey("PlayoutProgramScheduleAnchorPlayoutId", "PlayoutProgramScheduleAnchorProgramScheduleId", "PlayoutProgramScheduleAnchorMediaCollectionId"); |
||||
}); |
||||
|
||||
b.Navigation("EnumeratorState"); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("Playout"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceConnection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Connections") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSourceLibrary", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", null) |
||||
.WithMany("Libraries") |
||||
.HasForeignKey("PlexMediaSourceId"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", "MediaCollection") |
||||
.WithMany() |
||||
.HasForeignKey("MediaCollectionId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule") |
||||
.WithMany("Items") |
||||
.HasForeignKey("ProgramScheduleId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.Navigation("MediaCollection"); |
||||
|
||||
b.Navigation("ProgramSchedule"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("MediaItemSimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null) |
||||
.WithMany() |
||||
.HasForeignKey("ItemsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
|
||||
b.HasOne("ErsatzTV.Core.Domain.SimpleMediaCollection", null) |
||||
.WithMany() |
||||
.HasForeignKey("SimpleMediaCollectionsId") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.SimpleMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.SimpleMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.TelevisionMediaCollection", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaCollection", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.TelevisionMediaCollection", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.LocalMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.PlexMediaSource", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b => |
||||
{ |
||||
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null) |
||||
.WithOne() |
||||
.HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemOne", "Id") |
||||
.OnDelete(DeleteBehavior.Cascade) |
||||
.IsRequired(); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b => |
||||
{ |
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("ProgramScheduleAnchors"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b => |
||||
{ |
||||
b.Navigation("Items"); |
||||
|
||||
b.Navigation("Playouts"); |
||||
}); |
||||
|
||||
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b => |
||||
{ |
||||
b.Navigation("Connections"); |
||||
|
||||
b.Navigation("Libraries"); |
||||
}); |
||||
#pragma warning restore 612, 618
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class MetadataOptimizations : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"Metadata_LastWriteTime", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Metadata_Source", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"PosterLastWriteTime", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"Metadata_LastWriteTime", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Source", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"PosterLastWriteTime", |
||||
"MediaItems"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,453 @@
@@ -0,0 +1,453 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class TelevisionExpansion : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Aired", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_ContentRating", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Description", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_EpisodeNumber", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_MediaType", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_SeasonNumber", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_SortTitle", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Source", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Subtitle", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Metadata_Title", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_Width", |
||||
"MediaItems", |
||||
"Statistics_Width"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_VideoScanType", |
||||
"MediaItems", |
||||
"Statistics_VideoScanType"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_VideoCodec", |
||||
"MediaItems", |
||||
"Statistics_VideoCodec"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_SampleAspectRatio", |
||||
"MediaItems", |
||||
"Statistics_SampleAspectRatio"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_LastWriteTime", |
||||
"MediaItems", |
||||
"Statistics_LastWriteTime"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_Height", |
||||
"MediaItems", |
||||
"Statistics_Height"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_Duration", |
||||
"MediaItems", |
||||
"Statistics_Duration"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_DisplayAspectRatio", |
||||
"MediaItems", |
||||
"Statistics_DisplayAspectRatio"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Metadata_AudioCodec", |
||||
"MediaItems", |
||||
"Statistics_AudioCodec"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Movies", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
MetadataId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Movies", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Movies_MediaItems_Id", |
||||
x => x.Id, |
||||
"MediaItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShows", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Poster = table.Column<string>("TEXT", nullable: true), |
||||
PosterLastWriteTime = table.Column<DateTime>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_TelevisionShows", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MovieMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
MovieId = table.Column<int>("INTEGER", nullable: false), |
||||
Year = table.Column<int>("INTEGER", nullable: true), |
||||
Premiered = table.Column<DateTime>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
Tagline = table.Column<string>("TEXT", nullable: true), |
||||
ContentRating = table.Column<string>("TEXT", nullable: true), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MovieMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_MovieMetadata_Movies_MovieId", |
||||
x => x.MovieId, |
||||
"Movies", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionSeasons", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false), |
||||
Number = table.Column<int>("INTEGER", nullable: false), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
Poster = table.Column<string>("TEXT", nullable: true), |
||||
PosterLastWriteTime = table.Column<DateTime>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionSeasons", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionSeasons_TelevisionShows_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShows", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShowMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
Year = table.Column<int>("INTEGER", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionShowMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowMetadata_TelevisionShows_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShows", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShowSource", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false), |
||||
Discriminator = table.Column<string>("TEXT", nullable: false), |
||||
MediaSourceId = table.Column<int>("INTEGER", nullable: true), |
||||
Path = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionShowSource", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSources_MediaSourceId", |
||||
x => x.MediaSourceId, |
||||
"LocalMediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowSource_TelevisionShows_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShows", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionEpisodes", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
SeasonId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionEpisodes", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisodes_MediaItems_Id", |
||||
x => x.Id, |
||||
"MediaItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisodes_TelevisionSeasons_SeasonId", |
||||
x => x.SeasonId, |
||||
"TelevisionSeasons", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionEpisodeMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
TelevisionEpisodeId = table.Column<int>("INTEGER", nullable: false), |
||||
Season = table.Column<int>("INTEGER", nullable: false), |
||||
Episode = table.Column<int>("INTEGER", nullable: false), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Aired = table.Column<DateTime>("TEXT", nullable: true), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionEpisodeMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisodeMetadata_TelevisionEpisodes_TelevisionEpisodeId", |
||||
x => x.TelevisionEpisodeId, |
||||
"TelevisionEpisodes", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MovieMetadata_MovieId", |
||||
"MovieMetadata", |
||||
"MovieId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionEpisodeMetadata_TelevisionEpisodeId", |
||||
"TelevisionEpisodeMetadata", |
||||
"TelevisionEpisodeId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionEpisodes_SeasonId", |
||||
"TelevisionEpisodes", |
||||
"SeasonId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionSeasons_TelevisionShowId", |
||||
"TelevisionSeasons", |
||||
"TelevisionShowId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowMetadata_TelevisionShowId", |
||||
"TelevisionShowMetadata", |
||||
"TelevisionShowId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowSource_MediaSourceId", |
||||
"TelevisionShowSource", |
||||
"MediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowSource_TelevisionShowId", |
||||
"TelevisionShowSource", |
||||
"TelevisionShowId"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionEpisodeMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShowMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShowSource"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Movies"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionEpisodes"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionSeasons"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShows"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_Width", |
||||
"MediaItems", |
||||
"Metadata_Width"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_VideoScanType", |
||||
"MediaItems", |
||||
"Metadata_VideoScanType"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_VideoCodec", |
||||
"MediaItems", |
||||
"Metadata_VideoCodec"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_SampleAspectRatio", |
||||
"MediaItems", |
||||
"Metadata_SampleAspectRatio"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_LastWriteTime", |
||||
"MediaItems", |
||||
"Metadata_LastWriteTime"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_Height", |
||||
"MediaItems", |
||||
"Metadata_Height"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_Duration", |
||||
"MediaItems", |
||||
"Metadata_Duration"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_DisplayAspectRatio", |
||||
"MediaItems", |
||||
"Metadata_DisplayAspectRatio"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"Statistics_AudioCodec", |
||||
"MediaItems", |
||||
"Metadata_AudioCodec"); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"Metadata_Aired", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_ContentRating", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_Description", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Metadata_EpisodeNumber", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Metadata_MediaType", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Metadata_SeasonNumber", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_SortTitle", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Metadata_Source", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_Subtitle", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Metadata_Title", |
||||
"MediaItems", |
||||
"TEXT", |
||||
nullable: true); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,212 @@
@@ -0,0 +1,212 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class CollectionsRework : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"MediaItemSimpleMediaCollection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionMediaCollections"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionEpisodes", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionEpisodesId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionEpisodes", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionEpisodesId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionEpisodes_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionEpisodes_TelevisionEpisodes_TelevisionEpisodesId", |
||||
x => x.TelevisionEpisodesId, |
||||
"TelevisionEpisodes", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionMovies", |
||||
table => new |
||||
{ |
||||
MoviesId = table.Column<int>("INTEGER", nullable: false), |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionMovies", |
||||
x => new { x.MoviesId, x.SimpleMediaCollectionsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionMovies_Movies_MoviesId", |
||||
x => x.MoviesId, |
||||
"Movies", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionMovies_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionSeasons", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionSeasonsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionSeasons", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionSeasonsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionSeasons_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionSeasons_TelevisionSeasons_TelevisionSeasonsId", |
||||
x => x.TelevisionSeasonsId, |
||||
"TelevisionSeasons", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionShows", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionShowsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionShows", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionShowsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionShows_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionShows_TelevisionShows_TelevisionShowsId", |
||||
x => x.TelevisionShowsId, |
||||
"TelevisionShows", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionEpisodes_TelevisionEpisodesId", |
||||
"SimpleMediaCollectionEpisodes", |
||||
"TelevisionEpisodesId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionMovies_SimpleMediaCollectionsId", |
||||
"SimpleMediaCollectionMovies", |
||||
"SimpleMediaCollectionsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionSeasons_TelevisionSeasonsId", |
||||
"SimpleMediaCollectionSeasons", |
||||
"TelevisionSeasonsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionShows_TelevisionShowsId", |
||||
"SimpleMediaCollectionShows", |
||||
"TelevisionShowsId"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionEpisodes"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionMovies"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionSeasons"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionShows"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaItemSimpleMediaCollection", |
||||
table => new |
||||
{ |
||||
ItemsId = table.Column<int>("INTEGER", nullable: false), |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_MediaItemSimpleMediaCollection", |
||||
x => new { x.ItemsId, x.SimpleMediaCollectionsId }); |
||||
table.ForeignKey( |
||||
"FK_MediaItemSimpleMediaCollection_MediaItems_ItemsId", |
||||
x => x.ItemsId, |
||||
"MediaItems", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_MediaItemSimpleMediaCollection_SimpleMediaCollections_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionMediaCollections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
SeasonNumber = table.Column<int>("INTEGER", nullable: true), |
||||
ShowTitle = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionMediaCollections", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionMediaCollections_MediaCollections_Id", |
||||
x => x.Id, |
||||
"MediaCollections", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItemSimpleMediaCollection_SimpleMediaCollectionsId", |
||||
"MediaItemSimpleMediaCollection", |
||||
"SimpleMediaCollectionsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionMediaCollections_ShowTitle_SeasonNumber", |
||||
"TelevisionMediaCollections", |
||||
new[] { "ShowTitle", "SeasonNumber" }, |
||||
unique: true); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,209 @@
@@ -0,0 +1,209 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class ScheduleCollectionTypes : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleItemAnchors_MediaCollections_MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItems_MediaCollections_MediaCollectionId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_PlayoutProgramScheduleItemAnchors", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"CollectionType"); |
||||
|
||||
migrationBuilder.AlterColumn<int>( |
||||
"MediaCollectionId", |
||||
"ProgramScheduleItems", |
||||
"INTEGER", |
||||
nullable: true, |
||||
oldClrType: typeof(int), |
||||
oldType: "INTEGER"); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"CollectionType", |
||||
"ProgramScheduleItems", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionSeasonId", |
||||
"ProgramScheduleItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionShowId", |
||||
"ProgramScheduleItems", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Id", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0) |
||||
.Annotation("Sqlite:Autoincrement", true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"CollectionId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_PlayoutProgramScheduleItemAnchors", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"Id"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItems_TelevisionSeasonId", |
||||
"ProgramScheduleItems", |
||||
"TelevisionSeasonId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItems_TelevisionShowId", |
||||
"ProgramScheduleItems", |
||||
"TelevisionShowId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_PlayoutId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"PlayoutId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItems_MediaCollections_MediaCollectionId", |
||||
"ProgramScheduleItems", |
||||
"MediaCollectionId", |
||||
"MediaCollections", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItems_TelevisionSeasons_TelevisionSeasonId", |
||||
"ProgramScheduleItems", |
||||
"TelevisionSeasonId", |
||||
"TelevisionSeasons", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItems_TelevisionShows_TelevisionShowId", |
||||
"ProgramScheduleItems", |
||||
"TelevisionShowId", |
||||
"TelevisionShows", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItems_MediaCollections_MediaCollectionId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItems_TelevisionSeasons_TelevisionSeasonId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItems_TelevisionShows_TelevisionShowId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItems_TelevisionSeasonId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItems_TelevisionShowId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_PlayoutProgramScheduleItemAnchors", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_PlayoutId", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"CollectionType", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionSeasonId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionShowId", |
||||
"ProgramScheduleItems"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Id", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"CollectionId", |
||||
"PlayoutProgramScheduleItemAnchors"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"CollectionType", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"MediaCollectionId"); |
||||
|
||||
migrationBuilder.AlterColumn<int>( |
||||
"MediaCollectionId", |
||||
"ProgramScheduleItems", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0, |
||||
oldClrType: typeof(int), |
||||
oldType: "INTEGER", |
||||
oldNullable: true); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_PlayoutProgramScheduleItemAnchors", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
new[] { "PlayoutId", "ProgramScheduleId", "MediaCollectionId" }); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleItemAnchors_MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"MediaCollectionId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleItemAnchors_MediaCollections_MediaCollectionId", |
||||
"PlayoutProgramScheduleItemAnchors", |
||||
"MediaCollectionId", |
||||
"MediaCollections", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItems_MediaCollections_MediaCollectionId", |
||||
"ProgramScheduleItems", |
||||
"MediaCollectionId", |
||||
"MediaCollections", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class RemoveScheduleItemsAndPosters : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
// delete program schedule items that referenced television collections (that no longer exist)
|
||||
migrationBuilder.Sql( |
||||
"delete from ProgramScheduleItems where MediaCollectionId not in (select Id from SimpleMediaCollections)"); |
||||
|
||||
// delete television collections that no longer exist/work
|
||||
migrationBuilder.Sql( |
||||
"delete from MediaCollections where Id not in (select Id from SimpleMediaCollections)"); |
||||
|
||||
// delete all posters so they are all re-cached with a higher resolution
|
||||
migrationBuilder.Sql("update MediaItems set Poster = null"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class MediaSourceLastScan : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.AddColumn<DateTimeOffset>( |
||||
"LastScan", |
||||
"MediaSources", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.DropColumn( |
||||
"LastScan", |
||||
"MediaSources"); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,574 @@
@@ -0,0 +1,574 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class LibraryRework : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
// create local media source to attach all paths to
|
||||
migrationBuilder.Sql("INSERT INTO MediaSources (SourceType) Values (99)"); |
||||
migrationBuilder.Sql("INSERT INTO LocalMediaSources (Id, MediaType) Values (last_insert_rowid(), 99)"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Library", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
MediaKind = table.Column<int>("INTEGER", nullable: false), |
||||
LastScan = table.Column<DateTimeOffset>("TEXT", nullable: true), |
||||
MediaSourceId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Library", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Library_MediaSources_MediaSourceId", |
||||
x => x.MediaSourceId, |
||||
"MediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
|
||||
migrationBuilder.CreateTable( |
||||
"LocalLibrary", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_LocalLibrary", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_LocalLibrary_Library_Id", |
||||
x => x.Id, |
||||
"Library", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
// create local movies library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Movies', 1, Id FROM LocalMediaSources WHERE MediaType = 99");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_rowid())"); |
||||
|
||||
// create local shows library
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Library (Name, MediaKind, MediaSourceId)
|
||||
SELECT 'Shows', 2, Id FROM LocalMediaSources WHERE MediaType = 99");
|
||||
migrationBuilder.Sql("INSERT INTO LocalLibrary (Id) Values (last_insert_rowid())"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"LibraryPath", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
LibraryId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_LibraryPath", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_LibraryPath_Library_LibraryId", |
||||
x => x.LibraryId, |
||||
"Library", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
// migrate movie source/folders to library paths
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO LibraryPath (Path, LibraryId)
|
||||
SELECT lms.Folder, l.Id |
||||
FROM LocalMediaSources lms |
||||
LEFT OUTER JOIN Library l ON l.MediaKind = 1 |
||||
WHERE lms.MediaType = 2");
|
||||
|
||||
// migrate show source/folders to library paths
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO LibraryPath (Path, LibraryId)
|
||||
SELECT lms.Folder, l.Id |
||||
FROM LocalMediaSources lms |
||||
LEFT OUTER JOIN Library l ON l.MediaKind = 2 |
||||
WHERE lms.MediaType = 1");
|
||||
|
||||
// migrate media item links
|
||||
migrationBuilder.AddColumn<int>( |
||||
"LibraryPathId", |
||||
"MediaItems", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE MediaItems SET LibraryPathId =
|
||||
(SELECT l.Id FROM LibraryPath l INNER JOIN LocalMediaSources lms ON lms.Folder = l.Path WHERE lms.Id = MediaItems.MediaSourceId)");
|
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MediaSourceId", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_MediaItems_MediaSourceId", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_MediaItems_MediaSources_MediaSourceId", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItems_LibraryPathId", |
||||
"MediaItems", |
||||
"LibraryPathId"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_LocalMediaSources_MediaSources_Id", |
||||
"LocalMediaSources"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlexMediaSources_MediaSources_Id", |
||||
"PlexMediaSources"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSources_MediaSourceId", |
||||
"TelevisionShowSource"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaSourceConnections"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaSourceLibraries"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_MediaSources_Name", |
||||
"MediaSources"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_PlexMediaSources", |
||||
"PlexMediaSources"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_LocalMediaSources", |
||||
"LocalMediaSources"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"LastScan", |
||||
"MediaSources"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Name", |
||||
"MediaSources"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"SourceType", |
||||
"MediaSources"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Folder", |
||||
"LocalMediaSources"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MediaType", |
||||
"LocalMediaSources"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"PlexMediaSources", |
||||
newName: "PlexMediaSource"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"LocalMediaSources", |
||||
newName: "LocalMediaSource"); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"MovieId1", |
||||
"MovieMetadata", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"ServerName", |
||||
"PlexMediaSource", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_PlexMediaSource", |
||||
"PlexMediaSource", |
||||
"Id"); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_LocalMediaSource", |
||||
"LocalMediaSource", |
||||
"Id"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexConnection", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
IsActive = table.Column<bool>("INTEGER", nullable: false), |
||||
Uri = table.Column<string>("TEXT", nullable: true), |
||||
PlexMediaSourceId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexConnection", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexConnection_PlexMediaSource_PlexMediaSourceId", |
||||
x => x.PlexMediaSourceId, |
||||
"PlexMediaSource", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaItemPart", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
PlexId = table.Column<int>("INTEGER", nullable: false), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
Duration = table.Column<int>("INTEGER", nullable: false), |
||||
File = table.Column<string>("TEXT", nullable: true), |
||||
Size = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_PlexMediaItemPart", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexLibrary", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
ShouldSyncItems = table.Column<bool>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexLibrary", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexLibrary_Library_Id", |
||||
x => x.Id, |
||||
"Library", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMovies", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
PartId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMovies", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMovies_Movies_Id", |
||||
x => x.Id, |
||||
"Movies", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_PlexMovies_PlexMediaItemPart_PartId", |
||||
x => x.PartId, |
||||
"PlexMediaItemPart", |
||||
"Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MovieMetadata_MovieId1", |
||||
"MovieMetadata", |
||||
"MovieId1"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Library_MediaSourceId", |
||||
"Library", |
||||
"MediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_LibraryPath_LibraryId", |
||||
"LibraryPath", |
||||
"LibraryId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexConnection_PlexMediaSourceId", |
||||
"PlexConnection", |
||||
"PlexMediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexMovies_PartId", |
||||
"PlexMovies", |
||||
"PartId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_LocalMediaSource_MediaSources_Id", |
||||
"LocalMediaSource", |
||||
"Id", |
||||
"MediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_MediaItems_LibraryPath_LibraryPathId", |
||||
"MediaItems", |
||||
"LibraryPathId", |
||||
"LibraryPath", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_MovieMetadata_Movies_MovieId1", |
||||
"MovieMetadata", |
||||
"MovieId1", |
||||
"Movies", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlexMediaSource_MediaSources_Id", |
||||
"PlexMediaSource", |
||||
"Id", |
||||
"MediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSource_MediaSourceId", |
||||
"TelevisionShowSource", |
||||
"MediaSourceId", |
||||
"LocalMediaSource", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_LocalMediaSource_MediaSources_Id", |
||||
"LocalMediaSource"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_MediaItems_LibraryPath_LibraryPathId", |
||||
"MediaItems"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_MovieMetadata_Movies_MovieId1", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlexMediaSource_MediaSources_Id", |
||||
"PlexMediaSource"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSource_MediaSourceId", |
||||
"TelevisionShowSource"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"LibraryPath"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"LocalLibrary"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexConnection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexLibrary"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMovies"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Library"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"PlexMediaItemPart"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_MovieMetadata_MovieId1", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_PlexMediaSource", |
||||
"PlexMediaSource"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_LocalMediaSource", |
||||
"LocalMediaSource"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MovieId1", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"ServerName", |
||||
"PlexMediaSource"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"PlexMediaSource", |
||||
newName: "PlexMediaSources"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"LocalMediaSource", |
||||
newName: "LocalMediaSources"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"LibraryPathId", |
||||
"MediaItems", |
||||
"MediaSourceId"); |
||||
|
||||
migrationBuilder.RenameIndex( |
||||
"IX_MediaItems_LibraryPathId", |
||||
table: "MediaItems", |
||||
newName: "IX_MediaItems_MediaSourceId"); |
||||
|
||||
migrationBuilder.AddColumn<DateTimeOffset>( |
||||
"LastScan", |
||||
"MediaSources", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Name", |
||||
"MediaSources", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"SourceType", |
||||
"MediaSources", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Folder", |
||||
"LocalMediaSources", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"MediaType", |
||||
"LocalMediaSources", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_PlexMediaSources", |
||||
"PlexMediaSources", |
||||
"Id"); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_LocalMediaSources", |
||||
"LocalMediaSources", |
||||
"Id"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaSourceConnections", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
IsActive = table.Column<bool>("INTEGER", nullable: false), |
||||
PlexMediaSourceId = table.Column<int>("INTEGER", nullable: true), |
||||
Uri = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMediaSourceConnections", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMediaSourceConnections_PlexMediaSources_PlexMediaSourceId", |
||||
x => x.PlexMediaSourceId, |
||||
"PlexMediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"PlexMediaSourceLibraries", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Key = table.Column<string>("TEXT", nullable: true), |
||||
MediaType = table.Column<int>("INTEGER", nullable: false), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
PlexMediaSourceId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_PlexMediaSourceLibraries", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_PlexMediaSourceLibraries_PlexMediaSources_PlexMediaSourceId", |
||||
x => x.PlexMediaSourceId, |
||||
"PlexMediaSources", |
||||
"Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaSources_Name", |
||||
"MediaSources", |
||||
"Name", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexMediaSourceConnections_PlexMediaSourceId", |
||||
"PlexMediaSourceConnections", |
||||
"PlexMediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlexMediaSourceLibraries_PlexMediaSourceId", |
||||
"PlexMediaSourceLibraries", |
||||
"PlexMediaSourceId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_LocalMediaSources_MediaSources_Id", |
||||
"LocalMediaSources", |
||||
"Id", |
||||
"MediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_MediaItems_MediaSources_MediaSourceId", |
||||
"MediaItems", |
||||
"MediaSourceId", |
||||
"MediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlexMediaSources_MediaSources_Id", |
||||
"PlexMediaSources", |
||||
"Id", |
||||
"MediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSources_MediaSourceId", |
||||
"TelevisionShowSource", |
||||
"MediaSourceId", |
||||
"LocalMediaSources", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class RemoveOldMediaSources : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) => |
||||
// remove old source/folders
|
||||
migrationBuilder.Sql(@"DELETE FROM MediaSources WHERE Id NOT IN (SELECT MediaSourceId FROM Library)"); |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,257 @@
@@ -0,0 +1,257 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class TelevisionMediaItems : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionEpisodeId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionSeasonId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionShowId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Collection", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_Collection", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Show", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Show", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Show_MediaItem_Id", |
||||
x => x.Id, |
||||
"MediaItem", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"CollectionItem", |
||||
table => new |
||||
{ |
||||
CollectionId = table.Column<int>("INTEGER", nullable: false), |
||||
MediaItemId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_CollectionItem", x => new { x.CollectionId, x.MediaItemId }); |
||||
table.ForeignKey( |
||||
"FK_CollectionItem_Collection_CollectionId", |
||||
x => x.CollectionId, |
||||
"Collection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_CollectionItem_MediaItem_MediaItemId", |
||||
x => x.MediaItemId, |
||||
"MediaItem", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Season", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
ShowId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Season", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Season_MediaItem_Id", |
||||
x => x.Id, |
||||
"MediaItem", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Season_Show_ShowId", |
||||
x => x.ShowId, |
||||
"Show", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Episode", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
SeasonId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Episode", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Episode_MediaItem_Id", |
||||
x => x.Id, |
||||
"MediaItem", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Episode_Season_SeasonId", |
||||
x => x.SeasonId, |
||||
"Season", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_CollectionItem_MediaItemId", |
||||
"CollectionItem", |
||||
"MediaItemId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Episode_SeasonId", |
||||
"Episode", |
||||
"SeasonId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Season_ShowId", |
||||
"Season", |
||||
"ShowId"); |
||||
|
||||
// create show media items
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaItem (TelevisionShowId, LibraryPathId)
|
||||
SELECT distinct ts.Id, mi.LibraryPathId |
||||
FROM TelevisionShow ts |
||||
INNER JOIN TelevisionSeason tsn ON tsn.TelevisionShowId = ts.Id |
||||
INNER JOIN TelevisionEpisode te ON te.SeasonId = tsn.Id |
||||
INNER JOIN MediaItem mi on mi.Id = te.Id");
|
||||
|
||||
// create shows
|
||||
migrationBuilder.Sql(@"INSERT INTO Show (Id) SELECT Id FROM MediaItem WHERE TelevisionShowId > 0"); |
||||
|
||||
// create season media items
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaItem (TelevisionSeasonId, LibraryPathId)
|
||||
SELECT distinct tsn.Id, mi.LibraryPathId |
||||
FROM TelevisionSeason tsn |
||||
INNER JOIN TelevisionEpisode te ON te.SeasonId = tsn.Id |
||||
INNER JOIN MediaItem mi on mi.Id = te.Id");
|
||||
|
||||
// create seasons
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Season (Id, ShowId)
|
||||
SELECT mi.Id, mi2.Id |
||||
FROM MediaItem mi |
||||
INNER JOIN TelevisionSeason tsn ON tsn.Id = mi.TelevisionSeasonId |
||||
INNER JOIN MediaItem mi2 ON mi2.TelevisionShowId = tsn.TelevisionShowId AND mi.LibraryPathId = mi2.LibraryPathId");
|
||||
|
||||
// mark episode media items
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE MediaItem SET TelevisionEpisodeId = Id
|
||||
WHERE Id IN (SELECT Id FROM TelevisionEpisode)");
|
||||
|
||||
// create episodes
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO Episode (Id, SeasonId)
|
||||
SELECT mi.Id, mi2.Id |
||||
FROM MediaItem mi |
||||
INNER JOIN TelevisionEpisode te on mi.Id = te.Id |
||||
INNER JOIN MediaItem mi2 ON mi2.TelevisionSeasonId = te.SeasonId AND mi.LibraryPathId = mi2.LibraryPathId");
|
||||
|
||||
// collections
|
||||
migrationBuilder.Sql(@"INSERT INTO Collection (Name) SELECT Name FROM MediaCollection"); |
||||
|
||||
// collection movies
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO CollectionItem (CollectionId, MediaItemId)
|
||||
SELECT c.Id, smcm.MoviesId |
||||
FROM Collection c |
||||
INNER JOIN MediaCollection mc on mc.Name = c.Name |
||||
INNER JOIN SimpleMediaCollectionMovie smcm ON smcm.SimpleMediaCollectionsId = mc.Id");
|
||||
|
||||
// collection shows
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO CollectionItem (CollectionId, MediaItemId)
|
||||
SELECT c.Id, mi.Id |
||||
FROM Collection c |
||||
INNER JOIN MediaCollection mc on mc.Name = c.Name |
||||
INNER JOIN SimpleMediaCollectionShow smcs ON smcs.SimpleMediaCollectionsId = mc.Id |
||||
INNER JOIN MediaItem mi ON mi.TelevisionShowId = smcs.TelevisionShowsId");
|
||||
|
||||
// collection seasons
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO CollectionItem (CollectionId, MediaItemId)
|
||||
SELECT c.Id, mi.Id |
||||
FROM Collection c |
||||
INNER JOIN MediaCollection mc on mc.Name = c.Name |
||||
INNER JOIN SimpleMediaCollectionSeason smcs ON smcs.SimpleMediaCollectionsId = mc.Id |
||||
INNER JOIN MediaItem mi ON mi.TelevisionSeasonId = smcs.TelevisionSeasonsId");
|
||||
|
||||
// collection episodes
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO CollectionItem (CollectionId, MediaItemId)
|
||||
SELECT c.Id, mi.Id |
||||
FROM Collection c |
||||
INNER JOIN MediaCollection mc on mc.Name = c.Name |
||||
INNER JOIN SimpleMediaCollectionEpisode smce ON smce.SimpleMediaCollectionsId = mc.Id |
||||
INNER JOIN MediaItem mi ON mi.TelevisionEpisodeId = smce.TelevisionEpisodesId");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"CollectionItem"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Episode"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Collection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Season"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"Show"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionEpisodeId", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionSeasonId", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionShowId", |
||||
"MediaItem"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,137 @@
@@ -0,0 +1,137 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class ProgramSchedule_CollectionAndMediaItem : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"CollectionId", |
||||
"ProgramScheduleItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"MediaItemId", |
||||
"ProgramScheduleItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"MediaItemId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItem_CollectionId", |
||||
"ProgramScheduleItem", |
||||
"CollectionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItem_MediaItemId", |
||||
"ProgramScheduleItem", |
||||
"MediaItemId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"MediaItemId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"NewCollectionId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"NewCollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItem_CollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItem_MediaItemId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"CollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MediaItemId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MediaItemId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class ProgramSchedule_UpdateCollectionAndMediaItem : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
// update schedule items that reference collections
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE ProgramScheduleItem SET CollectionId =
|
||||
(SELECT c.Id FROM Collection c INNER JOIN MediaCollection mc ON mc.Name = c.Name WHERE mc.Id = MediaCollectionId) |
||||
WHERE MediaCollectionId > 0");
|
||||
|
||||
// update schedule items that reference shows
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE ProgramScheduleItem SET MediaItemId =
|
||||
(SELECT mi.Id FROM MediaItem mi WHERE mi.TelevisionShowId = ProgramScheduleItem.TelevisionShowId) |
||||
WHERE TelevisionShowId > 0");
|
||||
|
||||
// update schedule items that reference seasons
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE ProgramScheduleItem SET MediaItemId =
|
||||
(SELECT mi.Id FROM MediaItem mi WHERE mi.TelevisionSeasonId = ProgramScheduleItem.TelevisionSeasonId) |
||||
WHERE TelevisionSeasonId > 0");
|
||||
|
||||
// update anchors that reference collections
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE PlayoutProgramScheduleAnchor SET NewCollectionId =
|
||||
(SELECT c.Id FROM Collection c INNER JOIN MediaCollection mc on c.Name = mc.Name WHERE mc.Id = CollectionId) |
||||
WHERE CollectionType = 0");
|
||||
|
||||
// update anchors that reference shows
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE PlayoutProgramScheduleAnchor SET MediaItemId =
|
||||
(SELECT mi.Id from MediaItem mi WHERE mi.TelevisionShowId = CollectionId) |
||||
WHERE CollectionType = 1");
|
||||
|
||||
// update anchors that reference seasons
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE PlayoutProgramScheduleAnchor SET MediaItemId =
|
||||
(SELECT mi.Id FROM MediaItem mi WHERE mi.TelevisionSeasonId = CollectionId) |
||||
WHERE CollectionType = 2");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,223 @@
@@ -0,0 +1,223 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_VersionsAndMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"SeasonNumber", |
||||
"Season", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"EpisodeNumber", |
||||
"Episode", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"EpisodeMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Tagline = table.Column<string>("TEXT", nullable: true), |
||||
EpisodeId = table.Column<int>("INTEGER", nullable: false), |
||||
MetadataKind = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
OriginalTitle = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
ReleaseDate = table.Column<DateTimeOffset>("TEXT", nullable: true), |
||||
DateAdded = table.Column<DateTimeOffset>("TEXT", nullable: false), |
||||
DateUpdated = table.Column<DateTimeOffset>("TEXT", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_EpisodeMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_EpisodeMetadata_Episode_EpisodeId", |
||||
x => x.EpisodeId, |
||||
"Episode", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaVersion", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true), |
||||
Duration = table.Column<TimeSpan>("TEXT", nullable: false), |
||||
SampleAspectRatio = table.Column<string>("TEXT", nullable: true), |
||||
DisplayAspectRatio = table.Column<string>("TEXT", nullable: true), |
||||
VideoCodec = table.Column<string>("TEXT", nullable: true), |
||||
AudioCodec = table.Column<string>("TEXT", nullable: true), |
||||
IsInterlaced = table.Column<bool>("INTEGER", nullable: false), |
||||
Width = table.Column<int>("INTEGER", nullable: false), |
||||
Height = table.Column<int>("INTEGER", nullable: false), |
||||
EpisodeId = table.Column<int>("INTEGER", nullable: true), |
||||
MovieId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MediaVersion", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_MediaVersion_Episode_EpisodeId", |
||||
x => x.EpisodeId, |
||||
"Episode", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_MediaVersion_Movie_MovieId", |
||||
x => x.MovieId, |
||||
"Movie", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"NewMovieMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Tagline = table.Column<string>("TEXT", nullable: true), |
||||
MovieId = table.Column<int>("INTEGER", nullable: false), |
||||
MetadataKind = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
OriginalTitle = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
ReleaseDate = table.Column<DateTimeOffset>("TEXT", nullable: true), |
||||
DateAdded = table.Column<DateTimeOffset>("TEXT", nullable: false), |
||||
DateUpdated = table.Column<DateTimeOffset>("TEXT", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_NewMovieMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_NewMovieMetadata_Movie_MovieId", |
||||
x => x.MovieId, |
||||
"Movie", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"ShowMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Tagline = table.Column<string>("TEXT", nullable: true), |
||||
ShowId = table.Column<int>("INTEGER", nullable: false), |
||||
MetadataKind = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
OriginalTitle = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
ReleaseDate = table.Column<DateTimeOffset>("TEXT", nullable: true), |
||||
DateAdded = table.Column<DateTimeOffset>("TEXT", nullable: false), |
||||
DateUpdated = table.Column<DateTimeOffset>("TEXT", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ShowMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_ShowMetadata_Show_ShowId", |
||||
x => x.ShowId, |
||||
"Show", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaFile", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
MediaVersionId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MediaFile", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_MediaFile_MediaVersion_MediaVersionId", |
||||
x => x.MediaVersionId, |
||||
"MediaVersion", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_EpisodeMetadata_EpisodeId", |
||||
"EpisodeMetadata", |
||||
"EpisodeId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaFile_MediaVersionId", |
||||
"MediaFile", |
||||
"MediaVersionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaVersion_EpisodeId", |
||||
"MediaVersion", |
||||
"EpisodeId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaVersion_MovieId", |
||||
"MediaVersion", |
||||
"MovieId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_NewMovieMetadata_MovieId", |
||||
"NewMovieMetadata", |
||||
"MovieId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ShowMetadata_ShowId", |
||||
"ShowMetadata", |
||||
"ShowId"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"EpisodeMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaFile"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"NewMovieMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"ShowMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaVersion"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"SeasonNumber", |
||||
"Season"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"EpisodeNumber", |
||||
"Episode"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_SeasonAndEpisodeNumbers : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.Sql( |
||||
@"UPDATE Season SET SeasonNumber =
|
||||
(SELECT Number FROM TelevisionSeason ts INNER JOIN MediaItem mi on mi.Id = Season.Id AND mi.TelevisionSeasonId = ts.Id) |
||||
WHERE SeasonNumber = 0");
|
||||
|
||||
migrationBuilder.Sql( |
||||
@"UPDATE Episode SET EpisodeNumber =
|
||||
(SELECT Episode FROM TelevisionEpisodeMetadata tem INNER JOIN MediaItem mi ON mi.Id = Episode.Id AND mi.TelevisionEpisodeId = tem.TelevisionEpisodeId) |
||||
WHERE EpisodeNumber = 0");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_MovieMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"); |
||||
|
||||
migrationBuilder.Sql( |
||||
@$"INSERT INTO NewMovieMetadata (Outline, Plot, Tagline, MovieId, MetadataKind, Title, OriginalTitle, SortTitle, ReleaseDate, DateAdded, DateUpdated)
|
||||
SELECT mm.Outline, mm.Plot, mm.Tagline, m.Id, mm.Source, mm.Title, null, mm.SortTitle, mm.Premiered, '{now}', IFNULL(mm.LastWriteTime, '0001-01-01 00:00:00') |
||||
FROM MovieMetadata mm |
||||
INNER JOIN Movie m ON mm.MovieId = m.Id");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_TelevisionMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"); |
||||
|
||||
migrationBuilder.Sql( |
||||
$@"INSERT INTO ShowMetadata (Outline, Plot, Tagline, ShowId, MetadataKind, Title, OriginalTitle, SortTitle, ReleaseDate, DateAdded, DateUpdated)
|
||||
SELECT null, tsm.Plot, null, m.Id, tsm.Source, tsm.Title, null, tsm.SortTitle, tsm.Year || '-01-01 00:00:00', '{now}', '0001-01-01 00:00:00' |
||||
FROM TelevisionShowMetadata tsm |
||||
INNER JOIN MediaItem m ON tsm.TelevisionShowId = m.TelevisionShowId");
|
||||
|
||||
migrationBuilder.Sql( |
||||
$@"INSERT INTO EpisodeMetadata (Outline, Plot, Tagline, EpisodeId, MetadataKind, Title, OriginalTitle, SortTitle, ReleaseDate, DateAdded, DateUpdated)
|
||||
SELECT null, tem.Plot, null, m.Id, tem.Source, tem.Title, null, tem.SortTitle, tem.Aired, '{now}', IFNULL(tem.LastWriteTime, '0001-01-01 00:00:00') |
||||
FROM TelevisionEpisodeMetadata tem |
||||
INNER JOIN MediaItem m ON tem.TelevisionEpisodeId = m.TelevisionEpisodeId;");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Remove_OldMovieMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MetadataId", |
||||
"Movie"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"MetadataId", |
||||
"Movie", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MovieMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
ContentRating = table.Column<string>("TEXT", nullable: true), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
MovieId = table.Column<int>("INTEGER", nullable: false), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Premiered = table.Column<DateTime>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
Tagline = table.Column<string>("TEXT", nullable: true), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
Year = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_MovieMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_MovieMetadata_Movie_MovieId", |
||||
x => x.MovieId, |
||||
"Movie", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MovieMetadata_MovieId", |
||||
"MovieMetadata", |
||||
"MovieId", |
||||
unique: true); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,489 @@
@@ -0,0 +1,489 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Remove_OldTelevisionEntities : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.Sql( |
||||
@"UPDATE ProgramScheduleItem SET
|
||||
MediaCollectionId = null, |
||||
TelevisionSeasonId = null, |
||||
TelevisionShowId = null");
|
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_MediaCollection_MediaCollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_TelevisionSeason_TelevisionSeasonId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_TelevisionShow_TelevisionShowId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionEpisode"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionMovie"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionSeason"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollectionShow"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionEpisodeMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShowMetadata"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShowSource"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SimpleMediaCollection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionEpisode"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"MediaCollection"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionSeason"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"TelevisionShow"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItem_MediaCollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItem_TelevisionSeasonId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_ProgramScheduleItem_TelevisionShowId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"MediaCollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionSeasonId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionShowId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"CollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"MediaCollectionId", |
||||
"ProgramScheduleItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionSeasonId", |
||||
"ProgramScheduleItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionShowId", |
||||
"ProgramScheduleItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"CollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"MediaCollection", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Name = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_MediaCollection", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShow", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Poster = table.Column<string>("TEXT", nullable: true), |
||||
PosterLastWriteTime = table.Column<DateTime>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => { table.PrimaryKey("PK_TelevisionShow", x => x.Id); }); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollection", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_SimpleMediaCollection", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollection_MediaCollection_Id", |
||||
x => x.Id, |
||||
"MediaCollection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionSeason", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Number = table.Column<int>("INTEGER", nullable: false), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
Poster = table.Column<string>("TEXT", nullable: true), |
||||
PosterLastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionSeason", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionSeason_TelevisionShow_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShow", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShowMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
Year = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionShowMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowMetadata_TelevisionShow_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShow", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionShowSource", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Discriminator = table.Column<string>("TEXT", nullable: false), |
||||
TelevisionShowId = table.Column<int>("INTEGER", nullable: false), |
||||
MediaSourceId = table.Column<int>("INTEGER", nullable: true), |
||||
Path = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionShowSource", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowSource_LocalMediaSource_MediaSourceId", |
||||
x => x.MediaSourceId, |
||||
"LocalMediaSource", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_TelevisionShowSource_TelevisionShow_TelevisionShowId", |
||||
x => x.TelevisionShowId, |
||||
"TelevisionShow", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionMovie", |
||||
table => new |
||||
{ |
||||
MoviesId = table.Column<int>("INTEGER", nullable: false), |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionMovie", |
||||
x => new { x.MoviesId, x.SimpleMediaCollectionsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionMovie_Movie_MoviesId", |
||||
x => x.MoviesId, |
||||
"Movie", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionMovie_SimpleMediaCollection_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionShow", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionShowsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionShow", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionShowsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionShow_SimpleMediaCollection_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionShow_TelevisionShow_TelevisionShowsId", |
||||
x => x.TelevisionShowsId, |
||||
"TelevisionShow", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionSeason", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionSeasonsId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionSeason", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionSeasonsId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionSeason_SimpleMediaCollection_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionSeason_TelevisionSeason_TelevisionSeasonsId", |
||||
x => x.TelevisionSeasonsId, |
||||
"TelevisionSeason", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionEpisode", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
SeasonId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionEpisode", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisode_MediaItem_Id", |
||||
x => x.Id, |
||||
"MediaItem", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisode_TelevisionSeason_SeasonId", |
||||
x => x.SeasonId, |
||||
"TelevisionSeason", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SimpleMediaCollectionEpisode", |
||||
table => new |
||||
{ |
||||
SimpleMediaCollectionsId = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionEpisodesId = table.Column<int>("INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey( |
||||
"PK_SimpleMediaCollectionEpisode", |
||||
x => new { x.SimpleMediaCollectionsId, x.TelevisionEpisodesId }); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionEpisode_SimpleMediaCollection_SimpleMediaCollectionsId", |
||||
x => x.SimpleMediaCollectionsId, |
||||
"SimpleMediaCollection", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_SimpleMediaCollectionEpisode_TelevisionEpisode_TelevisionEpisodesId", |
||||
x => x.TelevisionEpisodesId, |
||||
"TelevisionEpisode", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"TelevisionEpisodeMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Aired = table.Column<DateTime>("TEXT", nullable: true), |
||||
Episode = table.Column<int>("INTEGER", nullable: false), |
||||
LastWriteTime = table.Column<DateTime>("TEXT", nullable: true), |
||||
Plot = table.Column<string>("TEXT", nullable: true), |
||||
Season = table.Column<int>("INTEGER", nullable: false), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
Source = table.Column<int>("INTEGER", nullable: false), |
||||
TelevisionEpisodeId = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_TelevisionEpisodeMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_TelevisionEpisodeMetadata_TelevisionEpisode_TelevisionEpisodeId", |
||||
x => x.TelevisionEpisodeId, |
||||
"TelevisionEpisode", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItem_MediaCollectionId", |
||||
"ProgramScheduleItem", |
||||
"MediaCollectionId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItem_TelevisionSeasonId", |
||||
"ProgramScheduleItem", |
||||
"TelevisionSeasonId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_ProgramScheduleItem_TelevisionShowId", |
||||
"ProgramScheduleItem", |
||||
"TelevisionShowId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaCollection_Name", |
||||
"MediaCollection", |
||||
"Name", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionEpisode_TelevisionEpisodesId", |
||||
"SimpleMediaCollectionEpisode", |
||||
"TelevisionEpisodesId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionMovie_SimpleMediaCollectionsId", |
||||
"SimpleMediaCollectionMovie", |
||||
"SimpleMediaCollectionsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionSeason_TelevisionSeasonsId", |
||||
"SimpleMediaCollectionSeason", |
||||
"TelevisionSeasonsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SimpleMediaCollectionShow_TelevisionShowsId", |
||||
"SimpleMediaCollectionShow", |
||||
"TelevisionShowsId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionEpisode_SeasonId", |
||||
"TelevisionEpisode", |
||||
"SeasonId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionEpisodeMetadata_TelevisionEpisodeId", |
||||
"TelevisionEpisodeMetadata", |
||||
"TelevisionEpisodeId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionSeason_TelevisionShowId", |
||||
"TelevisionSeason", |
||||
"TelevisionShowId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowMetadata_TelevisionShowId", |
||||
"TelevisionShowMetadata", |
||||
"TelevisionShowId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowSource_MediaSourceId", |
||||
"TelevisionShowSource", |
||||
"MediaSourceId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_TelevisionShowSource_TelevisionShowId", |
||||
"TelevisionShowSource", |
||||
"TelevisionShowId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_MediaCollection_MediaCollectionId", |
||||
"ProgramScheduleItem", |
||||
"MediaCollectionId", |
||||
"MediaCollection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_TelevisionSeason_TelevisionSeasonId", |
||||
"ProgramScheduleItem", |
||||
"TelevisionSeasonId", |
||||
"TelevisionSeason", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_TelevisionShow_TelevisionShowId", |
||||
"ProgramScheduleItem", |
||||
"TelevisionShowId", |
||||
"TelevisionShow", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,117 @@
@@ -0,0 +1,117 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class CleanUp_MovieMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_NewMovieMetadata_Movie_MovieId", |
||||
"NewMovieMetadata"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_NewMovieMetadata", |
||||
"NewMovieMetadata"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"NewMovieMetadata", |
||||
newName: "MovieMetadata"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"CollectionId"); |
||||
|
||||
migrationBuilder.RenameIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_NewCollectionId", |
||||
table: "PlayoutProgramScheduleAnchor", |
||||
newName: "IX_PlayoutProgramScheduleAnchor_CollectionId"); |
||||
|
||||
migrationBuilder.RenameIndex( |
||||
"IX_NewMovieMetadata_MovieId", |
||||
table: "MovieMetadata", |
||||
newName: "IX_MovieMetadata_MovieId"); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_MovieMetadata", |
||||
"MovieMetadata", |
||||
"Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_MovieMetadata_Movie_MovieId", |
||||
"MovieMetadata", |
||||
"MovieId", |
||||
"Movie", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_MovieMetadata_Movie_MovieId", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropPrimaryKey( |
||||
"PK_MovieMetadata", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.RenameTable( |
||||
"MovieMetadata", |
||||
newName: "NewMovieMetadata"); |
||||
|
||||
migrationBuilder.RenameColumn( |
||||
"CollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"NewCollectionId"); |
||||
|
||||
migrationBuilder.RenameIndex( |
||||
"IX_PlayoutProgramScheduleAnchor_CollectionId", |
||||
table: "PlayoutProgramScheduleAnchor", |
||||
newName: "IX_PlayoutProgramScheduleAnchor_NewCollectionId"); |
||||
|
||||
migrationBuilder.RenameIndex( |
||||
"IX_MovieMetadata_MovieId", |
||||
table: "NewMovieMetadata", |
||||
newName: "IX_NewMovieMetadata_MovieId"); |
||||
|
||||
migrationBuilder.AddPrimaryKey( |
||||
"PK_NewMovieMetadata", |
||||
"NewMovieMetadata", |
||||
"Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_NewMovieMetadata_Movie_MovieId", |
||||
"NewMovieMetadata", |
||||
"MovieId", |
||||
"Movie", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_NewCollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"NewCollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_MediaItemPathIndex : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
// delete orphan movies, if any exist
|
||||
migrationBuilder.Sql( |
||||
@"DELETE FROM MediaItem WHERE Id IN
|
||||
(SELECT mi.Id FROM Library l |
||||
INNER JOIN LibraryPath lp ON l.Id = lp.LibraryId |
||||
INNER JOIN MediaItem mi ON lp.Id = mi.LibraryPathId |
||||
LEFT OUTER JOIN Movie m ON mi.Id = m.Id |
||||
WHERE l.MediaKind = 1 AND m.Id IS NULL)");
|
||||
|
||||
// delete orphan episodes, if any exist
|
||||
migrationBuilder.Sql( |
||||
@"DELETE FROM MediaItem WHERE Id IN
|
||||
(SELECT mi.Id FROM Library l |
||||
INNER JOIN LibraryPath lp ON l.Id = lp.LibraryId |
||||
INNER JOIN MediaItem mi ON lp.Id = mi.LibraryPathId |
||||
LEFT OUTER JOIN Show s ON mi.Id = s.Id |
||||
LEFT OUTER JOIN Season ssn ON mi.Id = ssn.Id |
||||
LEFT OUTER JOIN Episode e ON mi.Id = e.Id |
||||
WHERE l.MediaKind = 2 AND s.Id IS NULL AND ssn.Id IS NULL AND e.Id IS NULL)");
|
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItem_Path", |
||||
"MediaItem", |
||||
"Path", |
||||
unique: true); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.DropIndex( |
||||
"IX_MediaItem_Path", |
||||
"MediaItem"); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,89 @@
@@ -0,0 +1,89 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_Artwork : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"Poster", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"PosterLastWriteTime", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"Artwork", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Path = table.Column<string>("TEXT", nullable: true), |
||||
ArtworkKind = table.Column<int>("INTEGER", nullable: false), |
||||
DateAdded = table.Column<DateTime>("TEXT", nullable: false), |
||||
DateUpdated = table.Column<DateTime>("TEXT", nullable: false), |
||||
EpisodeMetadataId = table.Column<int>("INTEGER", nullable: true), |
||||
MovieMetadataId = table.Column<int>("INTEGER", nullable: true), |
||||
ShowMetadataId = table.Column<int>("INTEGER", nullable: true) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_Artwork", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_Artwork_EpisodeMetadata_EpisodeMetadataId", |
||||
x => x.EpisodeMetadataId, |
||||
"EpisodeMetadata", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Artwork_MovieMetadata_MovieMetadataId", |
||||
x => x.MovieMetadataId, |
||||
"MovieMetadata", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
table.ForeignKey( |
||||
"FK_Artwork_ShowMetadata_ShowMetadataId", |
||||
x => x.ShowMetadataId, |
||||
"ShowMetadata", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Artwork_EpisodeMetadataId", |
||||
"Artwork", |
||||
"EpisodeMetadataId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Artwork_MovieMetadataId", |
||||
"Artwork", |
||||
"MovieMetadataId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Artwork_ShowMetadataId", |
||||
"Artwork", |
||||
"ShowMetadataId"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropTable( |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Poster", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"PosterLastWriteTime", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,80 @@
@@ -0,0 +1,80 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_SeasonMetadata : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"SeasonMetadataId", |
||||
"Artwork", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
"SeasonMetadata", |
||||
table => new |
||||
{ |
||||
Id = table.Column<int>("INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Outline = table.Column<string>("TEXT", nullable: true), |
||||
SeasonId = table.Column<int>("INTEGER", nullable: false), |
||||
MetadataKind = table.Column<int>("INTEGER", nullable: false), |
||||
Title = table.Column<string>("TEXT", nullable: true), |
||||
OriginalTitle = table.Column<string>("TEXT", nullable: true), |
||||
SortTitle = table.Column<string>("TEXT", nullable: true), |
||||
ReleaseDate = table.Column<DateTime>("TEXT", nullable: true), |
||||
DateAdded = table.Column<DateTime>("TEXT", nullable: false), |
||||
DateUpdated = table.Column<DateTime>("TEXT", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_SeasonMetadata", x => x.Id); |
||||
table.ForeignKey( |
||||
"FK_SeasonMetadata_Season_SeasonId", |
||||
x => x.SeasonId, |
||||
"Season", |
||||
"Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Artwork_SeasonMetadataId", |
||||
"Artwork", |
||||
"SeasonMetadataId"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_SeasonMetadata_SeasonId", |
||||
"SeasonMetadata", |
||||
"SeasonId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork", |
||||
"SeasonMetadataId", |
||||
"SeasonMetadata", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
"SeasonMetadata"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_Artwork_SeasonMetadataId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"SeasonMetadataId", |
||||
"Artwork"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_MetadataYear : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"Year", |
||||
"ShowMetadata", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Year", |
||||
"SeasonMetadata", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Year", |
||||
"MovieMetadata", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Year", |
||||
"EpisodeMetadata", |
||||
"INTEGER", |
||||
nullable: true); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"Year", |
||||
"ShowMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Year", |
||||
"SeasonMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Year", |
||||
"MovieMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Year", |
||||
"EpisodeMetadata"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Reset_MetadataDateUpdated : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.Sql(@"UPDATE MovieMetadata SET DateUpdated = '0001-01-01 00:00:00'"); |
||||
migrationBuilder.Sql(@"UPDATE ShowMetadata SET Year = substr(ReleaseDate, 1, 4)"); |
||||
migrationBuilder.Sql(@"UPDATE SeasonMetadata SET DateUpdated = '0001-01-01 00:00:00'"); |
||||
migrationBuilder.Sql(@"UPDATE EpisodeMetadata SET DateUpdated = '0001-01-01 00:00:00'"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_SeasonMetadataCascade : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork", |
||||
"SeasonMetadataId", |
||||
"SeasonMetadata", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_Artwork_SeasonMetadata_SeasonMetadataId", |
||||
"Artwork", |
||||
"SeasonMetadataId", |
||||
"SeasonMetadata", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_MediaVersionVideoScanKind : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.RenameColumn( |
||||
"IsInterlaced", |
||||
"MediaVersion", |
||||
"VideoScanKind"); |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.RenameColumn( |
||||
"VideoScanKind", |
||||
"MediaVersion", |
||||
"IsInterlaced"); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_MediaVersion : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
// movie versions
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaVersion (Name, Duration, SampleAspectRatio, DisplayAspectRatio, VideoCodec, AudioCodec, VideoScanKind, Width, Height, EpisodeId, MovieId)
|
||||
SELECT 'Main', mi.Statistics_Duration, mi.Statistics_SampleAspectRatio, mi.Statistics_DisplayAspectRatio, mi.Statistics_VideoCodec, mi.Statistics_AudioCodec, mi.Statistics_VideoScanType, mi.Statistics_Width, mi.Statistics_Height, null, m.Id |
||||
FROM MediaItem mi |
||||
INNER JOIN Movie m on m.Id = mi.Id");
|
||||
|
||||
// episode versions
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaVersion (Name, Duration, SampleAspectRatio, DisplayAspectRatio, VideoCodec, AudioCodec, VideoScanKind, Width, Height, EpisodeId, MovieId)
|
||||
SELECT 'Main', mi.Statistics_Duration, mi.Statistics_SampleAspectRatio, mi.Statistics_DisplayAspectRatio, mi.Statistics_VideoCodec, mi.Statistics_AudioCodec, mi.Statistics_VideoScanType, mi.Statistics_Width, mi.Statistics_Height, e.Id, null |
||||
FROM MediaItem mi |
||||
INNER JOIN Episode e on e.Id = mi.Id");
|
||||
|
||||
// movie files
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaFile (Path, MediaVersionId)
|
||||
SELECT mi.Path, mv.Id |
||||
FROM MediaItem mi |
||||
INNER JOIN MediaVersion mv ON mv.MovieId = mi.Id");
|
||||
|
||||
// episode files
|
||||
migrationBuilder.Sql( |
||||
@"INSERT INTO MediaFile (Path, MediaVersionId)
|
||||
SELECT mi.Path, mv.Id |
||||
FROM MediaItem mi |
||||
INNER JOIN MediaVersion mv ON mv.EpisodeId = mi.Id");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,189 @@
@@ -0,0 +1,189 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class CleanUp_MediaItemStatisticsAndPath : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropIndex( |
||||
"IX_MediaItem_Path", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"LastWriteTime", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Path", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_AudioCodec", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_DisplayAspectRatio", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_Duration", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_Height", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_LastWriteTime", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_SampleAspectRatio", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_VideoCodec", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_VideoScanType", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"Statistics_Width", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionEpisodeId", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionSeasonId", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"TelevisionShowId", |
||||
"MediaItem"); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"DateAdded", |
||||
"MediaVersion", |
||||
"TEXT", |
||||
nullable: false, |
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"DateUpdated", |
||||
"MediaVersion", |
||||
"TEXT", |
||||
nullable: false, |
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropColumn( |
||||
"DateAdded", |
||||
"MediaVersion"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"DateUpdated", |
||||
"MediaVersion"); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"LastWriteTime", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Path", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Statistics_AudioCodec", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Statistics_DisplayAspectRatio", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<TimeSpan>( |
||||
"Statistics_Duration", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Statistics_Height", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<DateTime>( |
||||
"Statistics_LastWriteTime", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Statistics_SampleAspectRatio", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
"Statistics_VideoCodec", |
||||
"MediaItem", |
||||
"TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Statistics_VideoScanType", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"Statistics_Width", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionEpisodeId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionSeasonId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.AddColumn<int>( |
||||
"TelevisionShowId", |
||||
"MediaItem", |
||||
"INTEGER", |
||||
nullable: false, |
||||
defaultValue: 0); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaItem_Path", |
||||
"MediaItem", |
||||
"Path", |
||||
unique: true); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_MediaVersionDateAdded : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"); |
||||
migrationBuilder.Sql($@"UPDATE MediaVersion SET DateAdded = '{now}'"); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,119 @@
@@ -0,0 +1,119 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_PlayoutDeleteCascades : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_MediaFile_Path", |
||||
"MediaFile", |
||||
"Path", |
||||
unique: true); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_MediaFile_Path", |
||||
"MediaFile"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_Collection_CollectionId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_PlayoutProgramScheduleAnchor_MediaItem_MediaItemId", |
||||
"PlayoutProgramScheduleAnchor", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_Collection_CollectionId", |
||||
"ProgramScheduleItem", |
||||
"CollectionId", |
||||
"Collection", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_ProgramScheduleItem_MediaItem_MediaItemId", |
||||
"ProgramScheduleItem", |
||||
"MediaItemId", |
||||
"MediaItem", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Restrict); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Add_ChannelArtwork : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
"ChannelId", |
||||
"Artwork", |
||||
"INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
"IX_Artwork_ChannelId", |
||||
"Artwork", |
||||
"ChannelId"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
"FK_Artwork_Channel_ChannelId", |
||||
"Artwork", |
||||
"ChannelId", |
||||
"Channel", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
"FK_Artwork_Channel_ChannelId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
"IX_Artwork_ChannelId", |
||||
"Artwork"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
"ChannelId", |
||||
"Artwork"); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Update_ChannelArtwork : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
var now = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF"); |
||||
|
||||
migrationBuilder.Sql( |
||||
$@"INSERT INTO Artwork (ArtworkKind, ChannelId, DateAdded, DateUpdated, Path)
|
||||
SELECT 2, c.Id, '{now}', '{now}', c.Logo |
||||
FROM Channel c |
||||
WHERE c.Logo is not null");
|
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Sqlite.Migrations |
||||
{ |
||||
public partial class Remove_ChannelLogo : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.DropColumn( |
||||
"Logo", |
||||
"Channel"); |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) => |
||||
migrationBuilder.AddColumn<string>( |
||||
"Logo", |
||||
"Channel", |
||||
"TEXT", |
||||
nullable: true); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue