1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 02:09:59 +00:00

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 @@ public static void Map()
Mapper.Entity<Config>().RegisterModel("Config"); Mapper.Entity<Config>().RegisterModel("Config");
Mapper.Entity<RootFolder>().RegisterModel("RootFolders").Ignore(r => r.FreeSpace); 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<ScheduledTask>().RegisterModel("ScheduledTasks");
Mapper.Entity<NotificationDefinition>().RegisterModel("NotificationDefinitions"); Mapper.Entity<NotificationDefinition>().RegisterModel("Notifications");
Mapper.Entity<SceneMapping>().RegisterModel("SceneMappings"); Mapper.Entity<SceneMapping>().RegisterModel("SceneMappings");