diff --git a/src/NzbDrone.Core/Datastore/Migration/016_updated_imported_history_item.cs b/src/NzbDrone.Core/Datastore/Migration/016_updated_imported_history_item.cs index fc28b2a42..1649cf300 100644 --- a/src/NzbDrone.Core/Datastore/Migration/016_updated_imported_history_item.cs +++ b/src/NzbDrone.Core/Datastore/Migration/016_updated_imported_history_item.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - Execute.Sql(@"UPDATE ""History"" SET ""Data"" = replace( ""Data"", '""Path""', '""ImportedPath""' ) WHERE ""EventType"" = 3"); + Execute.Sql("UPDATE \"History\" SET \"Data\" = replace( \"Data\", '\"Path\"', '\"ImportedPath\"' ) WHERE \"EventType\" = 3"); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs b/src/NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs index e3b38314a..8a3a06414 100644 --- a/src/NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs +++ b/src/NzbDrone.Core/Datastore/Migration/017_reset_scene_names.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Datastore.Migration protected override void MainDbUpgrade() { // we were storing new file name as scene name. - Execute.Sql(@"UPDATE ""EpisodeFiles"" SET ""SceneName"" = NULL where ""SceneName"" != NULL"); + Execute.Sql("UPDATE \"EpisodeFiles\" SET \"SceneName\" = NULL where \"SceneName\" != NULL"); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs b/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs index 58965548f..f19e1045a 100644 --- a/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs +++ b/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var allSeriesCmd = conn.CreateCommand()) { allSeriesCmd.Transaction = tran; - allSeriesCmd.CommandText = @"SELECT ""Id"" FROM ""Series"""; + allSeriesCmd.CommandText = "SELECT \"Id\" FROM \"Series\""; using (var allSeriesReader = allSeriesCmd.ExecuteReader()) { while (allSeriesReader.Read()) @@ -33,7 +33,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var seasonsCmd = conn.CreateCommand()) { seasonsCmd.Transaction = tran; - seasonsCmd.CommandText = string.Format(@"SELECT ""SeasonNumber"", ""Monitored"" FROM ""Seasons"" WHERE ""SeriesId"" = {0}", seriesId); + seasonsCmd.CommandText = $"SELECT \"SeasonNumber\", \"Monitored\" FROM \"Seasons\" WHERE \"SeriesId\" = {seriesId}"; using (var seasonReader = seasonsCmd.ExecuteReader()) { @@ -54,7 +54,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var updateCmd = conn.CreateCommand()) { - var text = string.Format("UPDATE \"Series\" SET \"Seasons\" = '{0}' WHERE \"Id\" = {1}", seasons.ToJson(), seriesId); + var text = $"UPDATE \"Series\" SET \"Seasons\" = '{seasons.ToJson()}' WHERE \"Id\" = {seriesId}"; updateCmd.Transaction = tran; updateCmd.CommandText = text; diff --git a/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs b/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs index 117dba3ff..c0bdbba8d 100644 --- a/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var namingConfigCmd = conn.CreateCommand()) { namingConfigCmd.Transaction = tran; - namingConfigCmd.CommandText = @"SELECT * FROM ""NamingConfig"" LIMIT 1"; + namingConfigCmd.CommandText = "SELECT * FROM \"NamingConfig\" LIMIT 1"; using (var namingConfigReader = namingConfigCmd.ExecuteReader()) { var separatorIndex = namingConfigReader.GetOrdinal("Separator"); diff --git a/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs b/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs index 7e210c002..43f8c6163 100644 --- a/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var namingConfigCmd = conn.CreateCommand()) { namingConfigCmd.Transaction = tran; - namingConfigCmd.CommandText = @"SELECT ""Value"" FROM ""Config"" WHERE ""Key"" = 'seasonfolderformat'"; + namingConfigCmd.CommandText = "SELECT \"Value\" FROM \"Config\" WHERE \"Key\" = 'seasonfolderformat'"; var seasonFormat = "Season {season}"; using (var namingConfigReader = namingConfigCmd.ExecuteReader()) diff --git a/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs b/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs index 11570fced..8ecb508cc 100644 --- a/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs +++ b/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var selectCommand = conn.CreateCommand()) { selectCommand.Transaction = tran; - selectCommand.CommandText = @"SELECT * FROM ""Notifications"" WHERE ""ConfigContract"" = 'PushoverSettings'"; + selectCommand.CommandText = "SELECT * FROM \"Notifications\" WHERE \"ConfigContract\" = 'PushoverSettings'"; using (var reader = selectCommand.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs b/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs index 79df9ae2a..96fffde59 100644 --- a/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs +++ b/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var qualityProfileCmd = conn.CreateCommand()) { qualityProfileCmd.Transaction = tran; - qualityProfileCmd.CommandText = @"SELECT ""Id"", ""Allowed"" FROM ""QualityProfiles"""; + qualityProfileCmd.CommandText = "SELECT \"Id\", \"Allowed\" FROM \"QualityProfiles\""; using (var qualityProfileReader = qualityProfileCmd.ExecuteReader()) { while (qualityProfileReader.Read()) @@ -75,7 +75,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var qualityModelCmd = conn.CreateCommand()) { qualityModelCmd.Transaction = tran; - qualityModelCmd.CommandText = @"SELECT Distinct ""Quality"" FROM """ + tableName + "\""; + qualityModelCmd.CommandText = $"SELECT Distinct \"Quality\" FROM \"{tableName}\""; using (var qualityModelReader = qualityModelCmd.ExecuteReader()) { while (qualityModelReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/037_add_configurable_qualities.cs b/src/NzbDrone.Core/Datastore/Migration/037_add_configurable_qualities.cs index 44d75df87..dbd4e1232 100644 --- a/src/NzbDrone.Core/Datastore/Migration/037_add_configurable_qualities.cs +++ b/src/NzbDrone.Core/Datastore/Migration/037_add_configurable_qualities.cs @@ -33,7 +33,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var qualitySizeCmd = conn.CreateCommand()) { qualitySizeCmd.Transaction = tran; - qualitySizeCmd.CommandText = @"SELECT ""QualityId"", ""MinSize"", ""MaxSize"" FROM ""QualitySizes"""; + qualitySizeCmd.CommandText = "SELECT \"QualityId\", \"MinSize\", \"MaxSize\" FROM \"QualitySizes\""; using (var qualitySizeReader = qualitySizeCmd.ExecuteReader()) { while (qualitySizeReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs b/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs index c7f2832b1..a481281a7 100644 --- a/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs +++ b/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var configCmd = conn.CreateCommand()) { configCmd.Transaction = tran; - configCmd.CommandText = @"SELECT * FROM ""Config"""; + configCmd.CommandText = "SELECT * FROM \"Config\""; using (var configReader = configCmd.ExecuteReader()) { var keyIndex = configReader.GetOrdinal("Key"); diff --git a/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs b/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs index 053abc23a..a9de5795a 100644 --- a/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs +++ b/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs @@ -27,13 +27,13 @@ namespace NzbDrone.Core.Datastore.Migration using (var cmd = conn.CreateCommand()) { cmd.Transaction = tran; - cmd.CommandText = @"SELECT ""Value"" FROM ""Config"" WHERE ""Key"" = 'downloadedepisodesfolder'"; + cmd.CommandText = "SELECT \"Value\" FROM \"Config\" WHERE \"Key\" = 'downloadedepisodesfolder'"; var result = cmd.ExecuteScalar(); if (result == null) { - cmd.CommandText = @"INSERT INTO ""Config"" (""Key"", ""Value"") VALUES ('enablecompleteddownloadhandling', 'True')"; + cmd.CommandText = "INSERT INTO \"Config\" (\"Key\", \"Value\") VALUES ('enablecompleteddownloadhandling', 'True')"; cmd.ExecuteNonQuery(); } } @@ -44,11 +44,11 @@ namespace NzbDrone.Core.Datastore.Migration using (var downloadClientsCmd = conn.CreateCommand()) { downloadClientsCmd.Transaction = tran; - downloadClientsCmd.CommandText = @"SELECT ""Value"" FROM ""Config"" WHERE ""Key"" = 'downloadedepisodesfolder'"; + downloadClientsCmd.CommandText = "SELECT \"Value\" FROM \"Config\" WHERE \"Key\" = 'downloadedepisodesfolder'"; var downloadedEpisodesFolder = downloadClientsCmd.ExecuteScalar() as string; downloadClientsCmd.Transaction = tran; - downloadClientsCmd.CommandText = @"SELECT ""Id"", ""Implementation"", ""Settings"", ""ConfigContract"" FROM ""DownloadClients"" WHERE ""ConfigContract"" = 'FolderSettings'"; + downloadClientsCmd.CommandText = "SELECT \"Id\", \"Implementation\", \"Settings\", \"ConfigContract\" FROM \"DownloadClients\" WHERE \"ConfigContract\" = 'FolderSettings'"; using (var downloadClientReader = downloadClientsCmd.ExecuteReader()) { while (downloadClientReader.Read()) @@ -141,7 +141,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var historyCmd = conn.CreateCommand()) { historyCmd.Transaction = tran; - historyCmd.CommandText = @"SELECT ""Id"", ""EpisodeId"", ""SeriesId"", ""SourceTitle"", ""Date"", ""Data"", ""EventType"" FROM ""History"" WHERE ""EventType"" IS NOT NULL"; + historyCmd.CommandText = "SELECT \"Id\", \"EpisodeId\", \"SeriesId\", \"SourceTitle\", \"Date\", \"Data\", \"EventType\" FROM \"History\" WHERE \"EventType\" IS NOT NULL"; using (var historyRead = historyCmd.ExecuteReader()) { while (historyRead.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/053_add_series_sorttitle.cs b/src/NzbDrone.Core/Datastore/Migration/053_add_series_sorttitle.cs index dfc00235c..02bf64232 100644 --- a/src/NzbDrone.Core/Datastore/Migration/053_add_series_sorttitle.cs +++ b/src/NzbDrone.Core/Datastore/Migration/053_add_series_sorttitle.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getSeriesCmd = conn.CreateCommand()) { getSeriesCmd.Transaction = tran; - getSeriesCmd.CommandText = @"SELECT ""Id"", ""Title"" FROM ""Series"""; + getSeriesCmd.CommandText = "SELECT \"Id\", \"Title\" FROM \"Series\""; using (var seriesReader = getSeriesCmd.ExecuteReader()) { while (seriesReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/057_convert_episode_file_path_to_relative.cs b/src/NzbDrone.Core/Datastore/Migration/057_convert_episode_file_path_to_relative.cs index bb9ea1040..e13596fe8 100644 --- a/src/NzbDrone.Core/Datastore/Migration/057_convert_episode_file_path_to_relative.cs +++ b/src/NzbDrone.Core/Datastore/Migration/057_convert_episode_file_path_to_relative.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getSeriesCmd = conn.CreateCommand()) { getSeriesCmd.Transaction = tran; - getSeriesCmd.CommandText = @"SELECT ""Id"", ""Path"" FROM ""Series"""; + getSeriesCmd.CommandText = "SELECT \"Id\", \"Path\" FROM \"Series\""; using (var seriesReader = getSeriesCmd.ExecuteReader()) { while (seriesReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs b/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs index 9a672dd46..bb24d8b02 100644 --- a/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs +++ b/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var qualityModelCmd = conn.CreateCommand()) { qualityModelCmd.Transaction = tran; - qualityModelCmd.CommandText = @"SELECT Distinct ""Quality"" FROM """ + tableName + "\""; + qualityModelCmd.CommandText = $"SELECT Distinct \"Quality\" FROM \"{tableName}\""; using (var qualityModelReader = qualityModelCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/068_add_release_restrictions.cs b/src/NzbDrone.Core/Datastore/Migration/068_add_release_restrictions.cs index 57b13a3ab..089496974 100644 --- a/src/NzbDrone.Core/Datastore/Migration/068_add_release_restrictions.cs +++ b/src/NzbDrone.Core/Datastore/Migration/068_add_release_restrictions.cs @@ -24,7 +24,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getRestictionsCmd = conn.CreateCommand()) { getRestictionsCmd.Transaction = tran; - getRestictionsCmd.CommandText = @"SELECT ""Value"" FROM ""Config"" WHERE ""Key"" = 'releaserestrictions'"; + getRestictionsCmd.CommandText = "SELECT \"Value\" FROM \"Config\" WHERE \"Key\" = 'releaserestrictions'"; using (var configReader = getRestictionsCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs b/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs index cb46ba6e1..2648a71e1 100644 --- a/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs +++ b/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var namingConfigCmd = conn.CreateCommand()) { namingConfigCmd.Transaction = tran; - namingConfigCmd.CommandText = @"SELECT ""StandardEpisodeFormat"", ""DailyEpisodeFormat"", ""AnimeEpisodeFormat"" FROM ""NamingConfig"" LIMIT 1"; + namingConfigCmd.CommandText = "SELECT \"StandardEpisodeFormat\", \"DailyEpisodeFormat\", \"AnimeEpisodeFormat\" FROM \"NamingConfig\" LIMIT 1"; using (var configReader = namingConfigCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs b/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs index 0eacdc984..03716e3a6 100644 --- a/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs +++ b/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs @@ -84,7 +84,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = conn.CreateCommand()) { getProfilesCmd.Transaction = tran; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""GrabDelay"" FROM ""Profiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"GrabDelay\" FROM \"Profiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/071_unknown_quality_in_profile.cs b/src/NzbDrone.Core/Datastore/Migration/071_unknown_quality_in_profile.cs index 2ef466fca..ca57b145f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/071_unknown_quality_in_profile.cs +++ b/src/NzbDrone.Core/Datastore/Migration/071_unknown_quality_in_profile.cs @@ -166,7 +166,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = _connection.CreateCommand()) { getProfilesCmd.Transaction = _transaction; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Name"", ""Cutoff"", ""Items"", ""Language"" FROM ""Profiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Name\", \"Cutoff\", \"Items\", \"Language\" FROM \"Profiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/072_history_grabid.cs b/src/NzbDrone.Core/Datastore/Migration/072_history_grabid.cs index 42a1a4957..b10e94b40 100644 --- a/src/NzbDrone.Core/Datastore/Migration/072_history_grabid.cs +++ b/src/NzbDrone.Core/Datastore/Migration/072_history_grabid.cs @@ -28,7 +28,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getHistory = conn.CreateCommand()) { getHistory.Transaction = tran; - getHistory.CommandText = @"SELECT ""Id"", ""Data"" FROM ""History"" WHERE ""Data"" LIKE '%downloadClientId%'"; + getHistory.CommandText = "SELECT \"Id\", \"Data\" FROM \"History\" WHERE \"Data\" LIKE '%downloadClientId%'"; using (var historyReader = getHistory.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/079_dedupe_tags.cs b/src/NzbDrone.Core/Datastore/Migration/079_dedupe_tags.cs index 700fb4ec5..8a6972f20 100644 --- a/src/NzbDrone.Core/Datastore/Migration/079_dedupe_tags.cs +++ b/src/NzbDrone.Core/Datastore/Migration/079_dedupe_tags.cs @@ -49,7 +49,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var tagCmd = conn.CreateCommand()) { tagCmd.Transaction = tran; - tagCmd.CommandText = @"SELECT ""Id"", ""Label"" FROM ""Tags"""; + tagCmd.CommandText = "SELECT \"Id\", \"Label\" FROM \"Tags\""; using (var tagReader = tagCmd.ExecuteReader()) { @@ -116,7 +116,7 @@ namespace NzbDrone.Core.Datastore.Migration Id = t.Id }); - var updateTagsSql = string.Format(@"UPDATE ""{0}"" SET ""Tags"" = @Tags WHERE ""Id"" = @Id", table); + var updateTagsSql = $"UPDATE \"{table}\" SET \"Tags\" = @Tags WHERE \"Id\" = @Id"; conn.Execute(updateTagsSql, updatedTags, transaction: tran); } @@ -129,7 +129,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var removeCmd = conn.CreateCommand()) { removeCmd.Transaction = tran; - removeCmd.CommandText = string.Format("DELETE FROM \"Tags\" WHERE \"Id\" IN ({0})", string.Join(", ", idsToRemove)); + removeCmd.CommandText = $"DELETE FROM \"Tags\" WHERE \"Id\" IN ({string.Join(", ", idsToRemove)})"; removeCmd.ExecuteNonQuery(); } } diff --git a/src/NzbDrone.Core/Datastore/Migration/102_add_language_to_episodeFiles_history_and_blacklist.cs b/src/NzbDrone.Core/Datastore/Migration/102_add_language_to_episodeFiles_history_and_blacklist.cs index 56e6e7aca..52cc063e1 100644 --- a/src/NzbDrone.Core/Datastore/Migration/102_add_language_to_episodeFiles_history_and_blacklist.cs +++ b/src/NzbDrone.Core/Datastore/Migration/102_add_language_to_episodeFiles_history_and_blacklist.cs @@ -35,7 +35,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfileCmd = conn.CreateCommand()) { getProfileCmd.Transaction = tran; - getProfileCmd.CommandText = @"SELECT ""Id"", ""Language"" FROM ""Profiles"""; + getProfileCmd.CommandText = "SELECT \"Id\", \"Language\" FROM \"Profiles\""; using (var profilesReader = getProfileCmd.ExecuteReader()) { @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getSeriesCmd = conn.CreateCommand()) { getSeriesCmd.Transaction = tran; - getSeriesCmd.CommandText = @"SELECT ""Id"", ""ProfileId"" FROM ""Series"""; + getSeriesCmd.CommandText = "SELECT \"Id\", \"ProfileId\" FROM \"Series\""; using (var seriesReader = getSeriesCmd.ExecuteReader()) { while (seriesReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/111_create_language_profiles.cs b/src/NzbDrone.Core/Datastore/Migration/111_create_language_profiles.cs index acbe067d4..1ef95814e 100644 --- a/src/NzbDrone.Core/Datastore/Migration/111_create_language_profiles.cs +++ b/src/NzbDrone.Core/Datastore/Migration/111_create_language_profiles.cs @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = conn.CreateCommand()) { getProfilesCmd.Transaction = tran; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Language"" FROM ""Profiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Language\" FROM \"Profiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/117_add_webrip_and_br480_qualites_in_profile.cs b/src/NzbDrone.Core/Datastore/Migration/117_add_webrip_and_br480_qualites_in_profile.cs index 6f5027838..edc34c25f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/117_add_webrip_and_br480_qualites_in_profile.cs +++ b/src/NzbDrone.Core/Datastore/Migration/117_add_webrip_and_br480_qualites_in_profile.cs @@ -154,7 +154,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = _connection.CreateCommand()) { getProfilesCmd.Transaction = _transaction; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Name"", ""Cutoff"", ""Items"" FROM ""Profiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Name\", \"Cutoff\", \"Items\" FROM \"Profiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/122_add_remux_qualities_in_profile.cs b/src/NzbDrone.Core/Datastore/Migration/122_add_remux_qualities_in_profile.cs index 116cdb118..aa06b8e17 100644 --- a/src/NzbDrone.Core/Datastore/Migration/122_add_remux_qualities_in_profile.cs +++ b/src/NzbDrone.Core/Datastore/Migration/122_add_remux_qualities_in_profile.cs @@ -115,7 +115,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = _connection.CreateCommand()) { getProfilesCmd.Transaction = _transaction; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Name"", ""Cutoff"", ""Items"" FROM ""Profiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Name\", \"Cutoff\", \"Items\" FROM \"Profiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/147_swap_filechmod_for_folderchmod.cs b/src/NzbDrone.Core/Datastore/Migration/147_swap_filechmod_for_folderchmod.cs index 043f59c52..589b9edbb 100644 --- a/src/NzbDrone.Core/Datastore/Migration/147_swap_filechmod_for_folderchmod.cs +++ b/src/NzbDrone.Core/Datastore/Migration/147_swap_filechmod_for_folderchmod.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getFileChmodCmd = conn.CreateCommand()) { getFileChmodCmd.Transaction = tran; - getFileChmodCmd.CommandText = @"SELECT ""Value"" FROM ""Config"" WHERE ""Key"" = 'filechmod'"; + getFileChmodCmd.CommandText = "SELECT \"Value\" FROM \"Config\" WHERE \"Key\" = 'filechmod'"; if (getFileChmodCmd.ExecuteScalar() is string fileChmod) { diff --git a/src/NzbDrone.Core/Datastore/Migration/155_add_arabic_and_hindi_languages.cs b/src/NzbDrone.Core/Datastore/Migration/155_add_arabic_and_hindi_languages.cs index 1221722c6..45c274451 100644 --- a/src/NzbDrone.Core/Datastore/Migration/155_add_arabic_and_hindi_languages.cs +++ b/src/NzbDrone.Core/Datastore/Migration/155_add_arabic_and_hindi_languages.cs @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = _connection.CreateCommand()) { getProfilesCmd.Transaction = _transaction; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Name"", ""Languages"", ""UpgradeAllowed"", ""Cutoff"" FROM ""LanguageProfiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Name\", \"Languages\", \"UpgradeAllowed\", \"Cutoff\" FROM \"LanguageProfiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/166_update_series_sort_title.cs b/src/NzbDrone.Core/Datastore/Migration/166_update_series_sort_title.cs index fc0cfad8e..281db2792 100644 --- a/src/NzbDrone.Core/Datastore/Migration/166_update_series_sort_title.cs +++ b/src/NzbDrone.Core/Datastore/Migration/166_update_series_sort_title.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getSeriesCmd = conn.CreateCommand()) { getSeriesCmd.Transaction = tran; - getSeriesCmd.CommandText = @"SELECT ""Id"", ""TvdbId"", ""Title"" FROM ""Series"""; + getSeriesCmd.CommandText = "SELECT \"Id\", \"TvdbId\", \"Title\" FROM \"Series\""; using (var seriesReader = getSeriesCmd.ExecuteReader()) { while (seriesReader.Read()) diff --git a/src/NzbDrone.Core/Datastore/Migration/169_add_malayalam _and_ukrainian_languages.cs b/src/NzbDrone.Core/Datastore/Migration/169_add_malayalam _and_ukrainian_languages.cs index baeedd61f..5ef76b7ef 100644 --- a/src/NzbDrone.Core/Datastore/Migration/169_add_malayalam _and_ukrainian_languages.cs +++ b/src/NzbDrone.Core/Datastore/Migration/169_add_malayalam _and_ukrainian_languages.cs @@ -100,7 +100,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfilesCmd = _connection.CreateCommand()) { getProfilesCmd.Transaction = _transaction; - getProfilesCmd.CommandText = @"SELECT ""Id"", ""Name"", ""Languages"", ""UpgradeAllowed"", ""Cutoff"" FROM ""LanguageProfiles"""; + getProfilesCmd.CommandText = "SELECT \"Id\", \"Name\", \"Languages\", \"UpgradeAllowed\", \"Cutoff\" FROM \"LanguageProfiles\""; using (var profileReader = getProfilesCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/171_add_custom_formats.cs b/src/NzbDrone.Core/Datastore/Migration/171_add_custom_formats.cs index 51f7140be..3a4454385 100644 --- a/src/NzbDrone.Core/Datastore/Migration/171_add_custom_formats.cs +++ b/src/NzbDrone.Core/Datastore/Migration/171_add_custom_formats.cs @@ -53,7 +53,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfiles = conn.CreateCommand()) { getProfiles.Transaction = tran; - getProfiles.CommandText = @"SELECT ""Id"" FROM ""QualityProfiles"""; + getProfiles.CommandText = "SELECT \"Id\" FROM \"QualityProfiles\""; using (var definitionsReader = getProfiles.ExecuteReader()) { @@ -154,7 +154,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var getProfiles = conn.CreateCommand()) { getProfiles.Transaction = tran; - getProfiles.CommandText = @"SELECT ""Id"", ""Name"" FROM ""CustomFormats"""; + getProfiles.CommandText = "SELECT \"Id\", \"Name\" FROM \"CustomFormats\""; using (var definitionsReader = getProfiles.ExecuteReader()) { @@ -189,7 +189,7 @@ namespace NzbDrone.Core.Datastore.Migration using (var namingConfigCmd = conn.CreateCommand()) { namingConfigCmd.Transaction = tran; - namingConfigCmd.CommandText = @"SELECT * FROM ""NamingConfig"" LIMIT 1"; + namingConfigCmd.CommandText = "SELECT * FROM \"NamingConfig\" LIMIT 1"; using (var namingConfigReader = namingConfigCmd.ExecuteReader()) { diff --git a/src/NzbDrone.Core/Datastore/Migration/184_remove_invalid_roksbox_metadata_images.cs b/src/NzbDrone.Core/Datastore/Migration/184_remove_invalid_roksbox_metadata_images.cs index 7fa592f1e..41bf34a92 100644 --- a/src/NzbDrone.Core/Datastore/Migration/184_remove_invalid_roksbox_metadata_images.cs +++ b/src/NzbDrone.Core/Datastore/Migration/184_remove_invalid_roksbox_metadata_images.cs @@ -8,8 +8,8 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - IfDatabase("sqlite").Execute.Sql(@"DELETE FROM ""MetadataFiles"" WHERE ""Consumer"" = 'RoksboxMetadata' AND ""Type"" = 5 AND (""RelativePath"" LIKE '%/metadata/%' OR ""RelativePath"" LIKE '%\metadata\%')"); - IfDatabase("postgresql").Execute.Sql(@"DELETE FROM ""MetadataFiles"" WHERE ""Consumer"" = 'RoksboxMetadata' AND ""Type"" = 5 AND (""RelativePath"" LIKE '%/metadata/%' OR ""RelativePath"" LIKE '%\\metadata\\%')"); + IfDatabase("sqlite").Execute.Sql("DELETE FROM \"MetadataFiles\" WHERE \"Consumer\" = 'RoksboxMetadata' AND \"Type\" = 5 AND (\"RelativePath\" LIKE '%/metadata/%' OR \"RelativePath\" LIKE '%\\metadata\\%')"); + IfDatabase("postgresql").Execute.Sql("DELETE FROM \"MetadataFiles\" WHERE \"Consumer\" = 'RoksboxMetadata' AND \"Type\" = 5 AND (\"RelativePath\" LIKE '%/metadata/%' OR \"RelativePath\" LIKE '%\\\\metadata\\\\%')"); } } }