Added the Notification Preferences to the user

This commit is contained in:
TidusJar 2018-09-19 13:38:41 +01:00
commit 2204559b0a
9 changed files with 1431 additions and 190 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations
{
public partial class UserNotificationPreferences : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UserNotificationPreferences",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
UserId = table.Column<string>(nullable: true),
Agent = table.Column<int>(nullable: false),
Enabled = table.Column<bool>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserNotificationPreferences", x => x.Id);
table.ForeignKey(
name: "FK_UserNotificationPreferences_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_UserNotificationPreferences_UserId",
table: "UserNotificationPreferences",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserNotificationPreferences");
}
}
}

View file

@ -14,7 +14,7 @@ namespace Ombi.Store.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846");
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
@ -870,6 +870,26 @@ namespace Ombi.Store.Migrations
b.ToTable("Tokens");
});
modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Agent");
b.Property<bool>("Enabled");
b.Property<string>("UserId");
b.Property<string>("Value");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserNotificationPreferences");
});
modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b =>
{
b.Property<int>("Id")
@ -1068,6 +1088,13 @@ namespace Ombi.Store.Migrations
.HasForeignKey("UserId");
});
modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b =>
{
b.HasOne("Ombi.Store.Entities.OmbiUser", "User")
.WithMany("UserNotificationPreferences")
.HasForeignKey("UserId");
});
modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b =>
{
b.HasOne("Ombi.Store.Repository.Requests.SeasonRequests", "Season")