mirror of https://github.com/ErsatzTV/ErsatzTV.git
24 changed files with 1947 additions and 164 deletions
@ -1,17 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ErsatzTV.Core.Domain |
|
||||||
{ |
|
||||||
public class MovieMetadata : MediaItemMetadata |
|
||||||
{ |
|
||||||
public int Id { get; set; } |
|
||||||
public int MovieId { get; set; } |
|
||||||
public Movie Movie { get; set; } |
|
||||||
public int? Year { get; set; } |
|
||||||
public DateTime? Premiered { get; set; } |
|
||||||
public string Plot { get; set; } |
|
||||||
public string Outline { get; set; } |
|
||||||
public string Tagline { get; set; } |
|
||||||
public string ContentRating { get; set; } |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,12 +0,0 @@ |
|||||||
using ErsatzTV.Core.Domain; |
|
||||||
using Microsoft.EntityFrameworkCore; |
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
|
||||||
|
|
||||||
namespace ErsatzTV.Infrastructure.Data.Configurations |
|
||||||
{ |
|
||||||
public class MovieMetadataConfiguration : IEntityTypeConfiguration<MovieMetadata> |
|
||||||
{ |
|
||||||
public void Configure(EntityTypeBuilder<MovieMetadata> builder) => |
|
||||||
builder.ToTable("MovieMetadata"); |
|
||||||
} |
|
||||||
} |
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,63 @@ |
|||||||
|
using System; |
||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.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); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue