updated history table

This commit is contained in:
kay.one 2013-06-08 23:20:38 -07:00
commit ca71025bca
13 changed files with 139 additions and 57 deletions

View file

@ -0,0 +1,24 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Tags("")]
[Migration(4)]
public class updated_history : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Delete.Table("History");
Create.TableForModel("History")
.WithColumn("EpisodeId").AsInt32()
.WithColumn("SeriesId").AsInt32()
.WithColumn("SourceTitle").AsString()
.WithColumn("Date").AsDateTime()
.WithColumn("Quality").AsString()
.WithColumn("Data").AsString();
}
}
}

View file

@ -40,9 +40,9 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<History.History>().RegisterModel("History")
.Relationships
.AutoMapICollectionOrComplexProperties();
// .Relationship();
// .HasOne(h => h.Episode, h => h.EpisodeId)
// .HasOne(h => h.Series, h => h.SeriesId);
// .Relationship();
// .HasOne(h => h.Episode, h => h.EpisodeId)
// .HasOne(h => h.Series, h => h.SeriesId);
Mapper.Entity<Series>().RegisterModel("Series")
.Ignore(s => s.RootFolderPath)
@ -79,6 +79,7 @@ namespace NzbDrone.Core.Datastore
MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(Dictionary<string, string>), new EmbeddedDocumentConverter());
}
private static void RegisterEmbeddedConverter()