Rules changes and rework

This commit is contained in:
Jamie.Rees 2017-06-06 09:27:51 +01:00
commit 9f4a8902f9
32 changed files with 2804 additions and 35 deletions

View file

@ -3,6 +3,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Ombi.Store.Entities;
namespace Ombi.Store.Context
@ -14,6 +15,8 @@ namespace Ombi.Store.Context
DbSet<RequestBlobs> Requests { get; set; }
DbSet<GlobalSettings> Settings { get; set; }
DbSet<PlexContent> PlexContent { get; set; }
DbSet<RadarrCache> RadarrCache { get; set; }
DatabaseFacade Database { get; }
DbSet<User> Users { get; set; }
EntityEntry<T> Entry<T>(T entry) where T : class;
EntityEntry<TEntity> Attach<TEntity>(TEntity entity) where TEntity : class;

View file

@ -1,8 +1,5 @@
using System;
using System.IO;
using System.Resources;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Ombi.Store.Entities;
namespace Ombi.Store.Context
@ -35,12 +32,7 @@ namespace Ombi.Store.Context
public DbSet<GlobalSettings> Settings { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<PlexContent> PlexContent { get; set; }
public EntityEntry<T> Entry<T>(T entry) where T : class
{
return base.Entry(entry);
}
public DbSet<RadarrCache> RadarrCache { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{

View file

@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Ombi.Store.Entities
{
[Table("RadarrCache")]
public class RadarrCache : Entity
{
public int TheMovieDbId { get; set; }
}
}

View file

@ -17,6 +17,12 @@ CREATE TABLE IF NOT EXISTS PlexContent
ReleaseYear varchar(100) NOT NULL
);
CREATE TABLE IF NOT EXISTS RadarrCache
(
Id INTEGER PRIMARY KEY AUTOINCREMENT,
TheMovieDbId INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS SeasonsContent
(
Id INTEGER PRIMARY KEY AUTOINCREMENT,