From bfcd05206f443a3bd22a4819533166e7779ca29a Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Sat, 21 Jan 2017 19:25:28 -0500 Subject: [PATCH] migration migrainetion --- .../Migration/119_create_netimport_table.cs | 18 ---------------- .../Migration/123_create_netimport_table.cs | 21 +++++++++++++++++++ src/NzbDrone.Core/NzbDrone.Core.csproj | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) delete mode 100644 src/NzbDrone.Core/Datastore/Migration/119_create_netimport_table.cs create mode 100644 src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/119_create_netimport_table.cs b/src/NzbDrone.Core/Datastore/Migration/119_create_netimport_table.cs deleted file mode 100644 index 0788c90d8..000000000 --- a/src/NzbDrone.Core/Datastore/Migration/119_create_netimport_table.cs +++ /dev/null @@ -1,18 +0,0 @@ -using FluentMigrator; -using NzbDrone.Core.Datastore.Migration.Framework; - -namespace NzbDrone.Core.Datastore.Migration -{ - [Migration(125)] - public class create_netimport_table : NzbDroneMigrationBase - { - protected override void MainDbUpgrade() - { - Create.TableForModel("NetImport") - .WithColumn("Enabled").AsBoolean() - .WithColumn("Name").AsString().Unique() - .WithColumn("Implementation").AsString() - .WithColumn("Settings").AsString().Nullable(); - } - } -} diff --git a/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs b/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs new file mode 100644 index 000000000..1e52f97d7 --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs @@ -0,0 +1,21 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(123)] + public class create_netimport_table : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + if (!this.Schema.Schema("dbo").Table("NetImport").Exists()) + { + Create.TableForModel("NetImport") + .WithColumn("Enabled").AsBoolean() + .WithColumn("Name").AsString().Unique() + .WithColumn("Implementation").AsString() + .WithColumn("Settings").AsString().Nullable(); + } + } + } +} diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index ea58ca869..8fe158776 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -122,7 +122,7 @@ - +