From ff0a04c3311000caeba750d2ab04e75998fddcca Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 21 Jul 2024 19:37:40 +0300 Subject: [PATCH] Remove SQLite specific schema condition from migrations --- .../Datastore/Migration/123_create_netimport_table.cs | 4 ++-- .../Datastore/Migration/133_add_minimumavailability.cs | 6 ++---- .../Datastore/Migration/137_add_import_exclusions_table.cs | 2 +- .../Datastore/Migration/140_add_alternative_titles_table.cs | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs b/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs index aec46763d..bf05d5891 100644 --- a/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs +++ b/src/NzbDrone.Core/Datastore/Migration/123_create_netimport_table.cs @@ -1,4 +1,4 @@ -using FluentMigrator; +using FluentMigrator; using NzbDrone.Core.Datastore.Migration.Framework; namespace NzbDrone.Core.Datastore.Migration @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - if (!Schema.Schema("dbo").Table("NetImport").Exists()) + if (!Schema.Table("NetImport").Exists()) { Create.TableForModel("NetImport") .WithColumn("Enabled").AsBoolean() diff --git a/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs b/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs index fcfc979f2..ccec2eeb2 100644 --- a/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs +++ b/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs @@ -1,6 +1,4 @@ using FluentMigrator; - -// using FluentMigrator.Expressions; using NzbDrone.Core.Datastore.Migration.Framework; using NzbDrone.Core.Movies; @@ -11,12 +9,12 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - if (!Schema.Schema("dbo").Table("NetImport").Column("MinimumAvailability").Exists()) + if (!Schema.Table("NetImport").Column("MinimumAvailability").Exists()) { Alter.Table("NetImport").AddColumn("MinimumAvailability").AsInt32().WithDefaultValue((int)MovieStatusType.Released); } - if (!Schema.Schema("dbo").Table("Movies").Column("MinimumAvailability").Exists()) + if (!Schema.Table("Movies").Column("MinimumAvailability").Exists()) { Alter.Table("Movies").AddColumn("MinimumAvailability").AsInt32().WithDefaultValue((int)MovieStatusType.Released); } diff --git a/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs b/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs index da5d6af19..c5eb3e49b 100644 --- a/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs +++ b/src/NzbDrone.Core/Datastore/Migration/137_add_import_exclusions_table.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - if (!Schema.Schema("dbo").Table("ImportExclusions").Exists()) + if (!Schema.Table("ImportExclusions").Exists()) { Create.TableForModel("ImportExclusions") .WithColumn("TmdbId").AsInt64().NotNullable().Unique().PrimaryKey() diff --git a/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs b/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs index 55712d9bf..4614139b0 100644 --- a/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs +++ b/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs @@ -1,4 +1,4 @@ -using FluentMigrator; +using FluentMigrator; using NzbDrone.Core.Datastore.Migration.Framework; namespace NzbDrone.Core.Datastore.Migration @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - if (!Schema.Schema("dbo").Table("alternative_titles").Exists()) + if (!Schema.Table("alternative_titles").Exists()) { Create.TableForModel("AlternativeTitles") .WithColumn("MovieId").AsInt64().NotNullable()