Update code to only add implemented parts of the schema

pull/2970/head
Patrick Barron 4 years ago
parent 032de931b1
commit 37dcbfbc39

@ -16,7 +16,7 @@ namespace Jellyfin.Server.Implementations
public partial class JellyfinDb : DbContext
{
public virtual DbSet<ActivityLog> ActivityLogs { get; set; }
public virtual DbSet<Artwork> Artwork { get; set; }
/*public virtual DbSet<Artwork> Artwork { get; set; }
public virtual DbSet<Book> Books { get; set; }
public virtual DbSet<BookMetadata> BookMetadata { get; set; }
public virtual DbSet<Chapter> Chapters { get; set; }
@ -63,7 +63,7 @@ namespace Jellyfin.Server.Implementations
public virtual DbSet<SeriesMetadata> SeriesMetadata { get; set; }
public virtual DbSet<Track> Tracks { get; set; }
public virtual DbSet<TrackMetadata> TrackMetadata { get; set; }
public virtual DbSet<User> Users { get; set; }
public virtual DbSet<User> Users { get; set; } */
/// <summary>
/// Gets or sets the default connection string.
@ -94,13 +94,13 @@ namespace Jellyfin.Server.Implementations
modelBuilder.HasDefaultSchema("jellyfin");
modelBuilder.Entity<Artwork>().HasIndex(t => t.Kind);
/*modelBuilder.Entity<Artwork>().HasIndex(t => t.Kind);
modelBuilder.Entity<Genre>().HasIndex(t => t.Name)
.IsUnique();
modelBuilder.Entity<LibraryItem>().HasIndex(t => t.UrlId)
.IsUnique();
.IsUnique();*/
OnModelCreatedImpl(modelBuilder);
}

@ -0,0 +1,73 @@
#pragma warning disable CS1591
#pragma warning disable SA1601
// <auto-generated />
using System;
using Jellyfin.Server.Implementations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Jellyfin.Server.Implementations.Migrations
{
[DbContext(typeof(JellyfinDb))]
[Migration("20200502231229_InitialSchema")]
partial class InitialSchema
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("jellyfin")
.HasAnnotation("ProductVersion", "3.1.3");
modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<string>("ItemId")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<int>("LogSeverity")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(512);
b.Property<string>("Overview")
.HasColumnType("TEXT")
.HasMaxLength(512);
b.Property<uint>("RowVersion")
.IsConcurrencyToken()
.HasColumnType("INTEGER");
b.Property<string>("ShortOverview")
.HasColumnType("TEXT")
.HasMaxLength(512);
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("ActivityLog");
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,46 @@
#pragma warning disable CS1591
#pragma warning disable SA1601
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Jellyfin.Server.Implementations.Migrations
{
public partial class InitialSchema : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "jellyfin");
migrationBuilder.CreateTable(
name: "ActivityLog",
schema: "jellyfin",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(maxLength: 512, nullable: false),
Overview = table.Column<string>(maxLength: 512, nullable: true),
ShortOverview = table.Column<string>(maxLength: 512, nullable: true),
Type = table.Column<string>(maxLength: 256, nullable: false),
UserId = table.Column<Guid>(nullable: false),
ItemId = table.Column<string>(maxLength: 256, nullable: true),
DateCreated = table.Column<DateTime>(nullable: false),
LogSeverity = table.Column<int>(nullable: false),
RowVersion = table.Column<uint>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ActivityLog", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActivityLog",
schema: "jellyfin");
}
}
}

@ -1,3 +1,6 @@
#pragma warning disable CS1591
#pragma warning disable SA1601
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

Loading…
Cancel
Save