From 5ea61ead269913e388b44de81c3c037af34a5aff Mon Sep 17 00:00:00 2001 From: Stephan Steiner Date: Wed, 31 Jul 2024 09:55:09 +0200 Subject: [PATCH 1/3] updated nuget packages removed unused using statements --- .../Common/RavenExtensions.cs | 4 ++-- .../004-MigrationsCanRelyOnDIServices.cs | 4 ---- Raven.Migrations.Sample/Program.cs | 6 ------ .../Raven.Migrations.Sample.csproj | 2 +- .../Services/SillyService.cs | 6 +----- Raven.Migrations.Sample/Startup.cs | 5 ----- .../Raven.Migrations.Tests.csproj | 19 +++++++++++-------- Raven.Migrations.Tests/RunnerTests.cs | 7 +++---- .../DependencyInjectionMigrationResolver.cs | 2 -- Raven.Migrations/Raven.Migrations.csproj | 8 ++++---- 10 files changed, 22 insertions(+), 41 deletions(-) diff --git a/Raven.Migrations.Sample/Common/RavenExtensions.cs b/Raven.Migrations.Sample/Common/RavenExtensions.cs index 182919a..2770dfb 100644 --- a/Raven.Migrations.Sample/Common/RavenExtensions.cs +++ b/Raven.Migrations.Sample/Common/RavenExtensions.cs @@ -16,10 +16,10 @@ public static IDocumentStore EnsureExists(this IDocumentStore store) using var dbSession = store.OpenSession(); dbSession.Query().Take(0).ToList(); } - catch (Raven.Client.Exceptions.Database.DatabaseDoesNotExistException) + catch (Client.Exceptions.Database.DatabaseDoesNotExistException) { // Create the database. - store.Maintenance.Server.Send(new Raven.Client.ServerWide.Operations.CreateDatabaseOperation(new Raven.Client.ServerWide.DatabaseRecord + store.Maintenance.Server.Send(new Client.ServerWide.Operations.CreateDatabaseOperation(new Client.ServerWide.DatabaseRecord { DatabaseName = store.Database })); diff --git a/Raven.Migrations.Sample/Migrations/004-MigrationsCanRelyOnDIServices.cs b/Raven.Migrations.Sample/Migrations/004-MigrationsCanRelyOnDIServices.cs index 1e06eb1..25e4327 100644 --- a/Raven.Migrations.Sample/Migrations/004-MigrationsCanRelyOnDIServices.cs +++ b/Raven.Migrations.Sample/Migrations/004-MigrationsCanRelyOnDIServices.cs @@ -1,8 +1,4 @@ using Raven.Migrations.Sample.Services; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Raven.Migrations.Sample.Migrations { diff --git a/Raven.Migrations.Sample/Program.cs b/Raven.Migrations.Sample/Program.cs index a49b083..37805ea 100644 --- a/Raven.Migrations.Sample/Program.cs +++ b/Raven.Migrations.Sample/Program.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace Raven.Migrations.Sample { diff --git a/Raven.Migrations.Sample/Raven.Migrations.Sample.csproj b/Raven.Migrations.Sample/Raven.Migrations.Sample.csproj index aa82544..317065b 100644 --- a/Raven.Migrations.Sample/Raven.Migrations.Sample.csproj +++ b/Raven.Migrations.Sample/Raven.Migrations.Sample.csproj @@ -3,7 +3,7 @@ net8.0 - + diff --git a/Raven.Migrations.Sample/Services/SillyService.cs b/Raven.Migrations.Sample/Services/SillyService.cs index 7d6cb94..3a4a151 100644 --- a/Raven.Migrations.Sample/Services/SillyService.cs +++ b/Raven.Migrations.Sample/Services/SillyService.cs @@ -1,8 +1,4 @@ -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System; namespace Raven.Migrations.Sample.Services { diff --git a/Raven.Migrations.Sample/Startup.cs b/Raven.Migrations.Sample/Startup.cs index 156315b..fc370da 100644 --- a/Raven.Migrations.Sample/Startup.cs +++ b/Raven.Migrations.Sample/Startup.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; diff --git a/Raven.Migrations.Tests/Raven.Migrations.Tests.csproj b/Raven.Migrations.Tests/Raven.Migrations.Tests.csproj index 7ca03a4..b716e28 100644 --- a/Raven.Migrations.Tests/Raven.Migrations.Tests.csproj +++ b/Raven.Migrations.Tests/Raven.Migrations.Tests.csproj @@ -4,14 +4,17 @@ false - - - - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Raven.Migrations.Tests/RunnerTests.cs b/Raven.Migrations.Tests/RunnerTests.cs index 637d0c4..ada9378 100644 --- a/Raven.Migrations.Tests/RunnerTests.cs +++ b/Raven.Migrations.Tests/RunnerTests.cs @@ -1,10 +1,9 @@ -using System.Linq; -using System.Reflection; -using FluentAssertions; +using FluentAssertions; using Raven.Client.Documents.Indexes; using Raven.TestDriver; +using System.Linq; +using System.Reflection; using Xunit; -using static System.Formats.Asn1.AsnWriter; namespace Raven.Migrations.Tests { diff --git a/Raven.Migrations/DependencyInjectionMigrationResolver.cs b/Raven.Migrations/DependencyInjectionMigrationResolver.cs index 92923d6..1f719bb 100644 --- a/Raven.Migrations/DependencyInjectionMigrationResolver.cs +++ b/Raven.Migrations/DependencyInjectionMigrationResolver.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace Raven.Migrations { diff --git a/Raven.Migrations/Raven.Migrations.csproj b/Raven.Migrations/Raven.Migrations.csproj index bbf2b06..a4289e7 100644 --- a/Raven.Migrations/Raven.Migrations.csproj +++ b/Raven.Migrations/Raven.Migrations.csproj @@ -31,10 +31,10 @@ readme.md - - - - + + + + From edfc51070c550fa79099e21041f835536721fd54 Mon Sep 17 00:00:00 2001 From: Stephan Steiner Date: Wed, 31 Jul 2024 16:24:21 +0200 Subject: [PATCH 2/3] increased version number --- Raven.Migrations/Raven.Migrations.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Raven.Migrations/Raven.Migrations.csproj b/Raven.Migrations/Raven.Migrations.csproj index a4289e7..ae1af08 100644 --- a/Raven.Migrations/Raven.Migrations.csproj +++ b/Raven.Migrations/Raven.Migrations.csproj @@ -1,8 +1,8 @@ - + net8.0 true - 6.0.1 + 6.0.2 RavenMigrations Darrel Portzline, Khalid Abuhakmeh, Judah Gabriel Himango BitShuva From 45a9863cfaaaeb8a6a8c2cc8fd0eba53cecdb7ee Mon Sep 17 00:00:00 2001 From: Stephan Steiner Date: Wed, 31 Jul 2024 16:40:51 +0200 Subject: [PATCH 3/3] fixed ToVersion not being heeded when a previous migration already ran to this version --- Raven.Migrations/MigrationRunner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Raven.Migrations/MigrationRunner.cs b/Raven.Migrations/MigrationRunner.cs index 3e3e62d..ba2a280 100644 --- a/Raven.Migrations/MigrationRunner.cs +++ b/Raven.Migrations/MigrationRunner.cs @@ -89,7 +89,7 @@ void ExecuteMigration(Directions direction, long version, Migration migration, A if (migrationDoc == null) { skipCount++; - continue; + break; } ExecuteMigration(options.Direction, pair.Attribute!.Version, migration, () => { @@ -103,7 +103,7 @@ void ExecuteMigration(Directions direction, long version, Migration migration, A if (migrationDoc != null) { skipCount++; - continue; + break; } ExecuteMigration(options.Direction, pair.Attribute!.Version, migration, () => {