Added migration for notifications

This commit is contained in:
Mark McDowall 2013-05-22 20:58:39 -07:00
parent c039aedbb9
commit dbc20a3c31
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,29 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Tags("")]
[Migration(20130522)]
public class Migration20130522 : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.Sql("DROP TABLE IF EXISTS NotificationDefinitions");
Rename.Table("IndexerDefinitions")
.To("Indexers");
Create.TableForModel("Notifications")
.WithColumn("Name").AsString()
.WithColumn("OnGrab").AsBoolean()
.WithColumn("OnDownload").AsBoolean()
.WithColumn("Settings").AsString()
.WithColumn("Implementation").AsString();
}
protected override void LogDbUpgrade()
{
}
}
}

View File

@ -33,9 +33,9 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<Config>().RegisterModel("Config");
Mapper.Entity<RootFolder>().RegisterModel("RootFolders").Ignore(r => r.FreeSpace);
Mapper.Entity<IndexerDefinition>().RegisterModel("IndexerDefinitions");
Mapper.Entity<IndexerDefinition>().RegisterModel("Indexers");
Mapper.Entity<ScheduledTask>().RegisterModel("ScheduledTasks");
Mapper.Entity<NotificationDefinition>().RegisterModel("NotificationDefinitions");
Mapper.Entity<NotificationDefinition>().RegisterModel("Notifications");
Mapper.Entity<SceneMapping>().RegisterModel("SceneMappings");