Requests now work for albums !wip

This commit is contained in:
Jamie 2018-08-24 16:32:19 +01:00
commit d47e7a7c57
13 changed files with 1250 additions and 17 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations
{
public partial class MusicRequests : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "MusicRequestLimit",
table: "AspNetUsers",
nullable: true);
migrationBuilder.CreateTable(
name: "AlbumRequests",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Title = table.Column<string>(nullable: true),
Approved = table.Column<bool>(nullable: false),
MarkedAsApproved = table.Column<DateTime>(nullable: false),
RequestedDate = table.Column<DateTime>(nullable: false),
Available = table.Column<bool>(nullable: false),
MarkedAsAvailable = table.Column<DateTime>(nullable: true),
RequestedUserId = table.Column<string>(nullable: true),
Denied = table.Column<bool>(nullable: true),
MarkedAsDenied = table.Column<DateTime>(nullable: false),
DeniedReason = table.Column<string>(nullable: true),
RequestType = table.Column<int>(nullable: false),
ForeignAlbumId = table.Column<string>(nullable: true),
ForeignArtistId = table.Column<string>(nullable: true),
Disk = table.Column<string>(nullable: true),
Cover = table.Column<string>(nullable: true),
Rating = table.Column<decimal>(nullable: false),
ReleaseDate = table.Column<DateTime>(nullable: false),
ArtistName = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AlbumRequests", x => x.Id);
table.ForeignKey(
name: "FK_AlbumRequests_AspNetUsers_RequestedUserId",
column: x => x.RequestedUserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_AlbumRequests_RequestedUserId",
table: "AlbumRequests",
column: "RequestedUserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AlbumRequests");
migrationBuilder.DropColumn(
name: "MusicRequestLimit",
table: "AspNetUsers");
}
}
}

View file

@ -311,6 +311,8 @@ namespace Ombi.Store.Migrations
b.Property<int?>("MovieRequestLimit");
b.Property<int?>("MusicRequestLimit");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
@ -460,6 +462,54 @@ namespace Ombi.Store.Migrations
b.ToTable("RecentlyAddedLog");
});
modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("Approved");
b.Property<string>("ArtistName");
b.Property<bool>("Available");
b.Property<string>("Cover");
b.Property<bool?>("Denied");
b.Property<string>("DeniedReason");
b.Property<string>("Disk");
b.Property<string>("ForeignAlbumId");
b.Property<string>("ForeignArtistId");
b.Property<DateTime>("MarkedAsApproved");
b.Property<DateTime?>("MarkedAsAvailable");
b.Property<DateTime>("MarkedAsDenied");
b.Property<decimal>("Rating");
b.Property<DateTime>("ReleaseDate");
b.Property<int>("RequestType");
b.Property<DateTime>("RequestedDate");
b.Property<string>("RequestedUserId");
b.Property<string>("Title");
b.HasKey("Id");
b.HasIndex("RequestedUserId");
b.ToTable("AlbumRequests");
});
modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b =>
{
b.Property<int>("Id")
@ -894,6 +944,13 @@ namespace Ombi.Store.Migrations
.HasForeignKey("PlexServerContentId");
});
modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b =>
{
b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser")
.WithMany()
.HasForeignKey("RequestedUserId");
});
modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b =>
{
b.HasOne("Ombi.Store.Entities.Requests.TvRequests", "ParentRequest")