From dbc20a3c3150793680562b5bd25d9216fc83956e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 22 May 2013 20:58:39 -0700 Subject: [PATCH] Added migration for notifications --- .../Datastore/Migration/Migration20130522.cs | 29 +++++++++++++++++++ NzbDrone.Core/Datastore/TableMapping.cs | 4 +-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 NzbDrone.Core/Datastore/Migration/Migration20130522.cs diff --git a/NzbDrone.Core/Datastore/Migration/Migration20130522.cs b/NzbDrone.Core/Datastore/Migration/Migration20130522.cs new file mode 100644 index 000000000..b356efbca --- /dev/null +++ b/NzbDrone.Core/Datastore/Migration/Migration20130522.cs @@ -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() + { + } + } +} diff --git a/NzbDrone.Core/Datastore/TableMapping.cs b/NzbDrone.Core/Datastore/TableMapping.cs index 2bc00929a..7abec53f4 100644 --- a/NzbDrone.Core/Datastore/TableMapping.cs +++ b/NzbDrone.Core/Datastore/TableMapping.cs @@ -33,9 +33,9 @@ namespace NzbDrone.Core.Datastore Mapper.Entity().RegisterModel("Config"); Mapper.Entity().RegisterModel("RootFolders").Ignore(r => r.FreeSpace); - Mapper.Entity().RegisterModel("IndexerDefinitions"); + Mapper.Entity().RegisterModel("Indexers"); Mapper.Entity().RegisterModel("ScheduledTasks"); - Mapper.Entity().RegisterModel("NotificationDefinitions"); + Mapper.Entity().RegisterModel("Notifications"); Mapper.Entity().RegisterModel("SceneMappings");