FluentMigrator v3.0.0 Release Notes
Release Date: 2018-05-07 // almost 6 years ago-
๐ The new documentation is online on https://fluentmigrator.github.io.
โฌ๏ธ Upgrade Guide
โฌ๏ธ https://fluentmigrator.github.io/articles/guides/upgrades/guide-2.0-to-3.0.html
What changed?
๐ฅ Breaking changes
- ๐ #850: Set minimum .NET Framework version to 4.6.1. Older versions aren't supported anymore.
- โฑ
ProcessorOptions.Timeout
is now of typeSystem.TimeSpan?
- ๐ง
MigrationRunner.MaintenanceLoader
is now read-only MigrationRunner.CaughtExceptions
returns now aIReadOnlyList
dotnet-fm
is now a global tool and requires at least the .NET Core tooling 2.1-preview2
โ Added
- #851: Enable the usage of Microsoft.Extensions.DependencyInjection
- ๐ง #852: Replace custom configuration mechanisms by using Microsoft.Extensions.Options
- ๐ฒ #853: Replace the announcer with Microsoft.Extensions.Logging
- ๐ Support for loading connection strings using a provided
IConfiguration
service (Microsoft.Extensions.Configuration) - #822:
IMigrationExpressionValidator
for custom migration expression validation - #809: Ability to add a schema owner during schema creation for SQL Server
๐ Fixed
- #767: Append
NULL
constraint for custom types for PostgreSQL and SQL Server
๐ Deprecated
IAssemblyCollection
and all its implementationsIAnnouncer
and all its implementationsIMigrationRunnerConventions.GetMigrationInfo
IProfileLoader.ApplyProfiles()
IProfileLoader.FindProfilesIn
IMigrationProcessorOptions
IMigrationProcessorFactory
and all its implementationsIRunnerContext
andRunnerContext
, replaced by several dedicated options classes:RunnerOptions
are the newRunnerContext
(minus some properties extracted into separate option classes)ProcessorOptions
for global processor-specific optionsGeneratorOptions
to allow setting the compatibility modeTypeFilterOptions
for filtering migrations by namespaceAnnouncerOptions
to enable showing SQL statements and the elapsed timeSelectingProcessorAccessorOptions
allows selection of a processor by its identifierSelectingGeneratorAccessorOptions
allows selection of a generator by its identifierAppConfigConnectionStringAccessorOptions
to allow leading the connection strings from the *.config xml file (deprecated, only for transition toMicrosoft.Extensions.Configuration
)
CompatabilityMode
(is nowComatibilityMode
)ApplicationContext
in various interfaces/classesManifestResourceNameWithAssembly
replaced byValueTuple
MigrationGeneratorFactory
MigrationProcessorFactoryProvider
ITypeMap.GetTypeMap(DbType, int, int)
IDbFactory
: Only the implementations will remain- Several non-DI constructors
โ Additional information
Connection string handling
The library assumes that in
ProcessorOptions.ConnectionString
is either a connection string or
a connection string identifier. This are the steps to load the real connection string.- Queries all
IConnectionStringReader
implementations- When a connection string is returned by one of the readers, then this
connection string will be used - When no connection string is returned, try reading from the next
IConnectionStringReader
- When a connection string is returned by one of the readers, then this
- When no reader returned a connection string, then return
ProcessorOptions.ConnectionString
The connection string stored in
ProcessorOptions.ConnectionString
might be overridden
by registering theIConnectionStringReader
instancePassThroughConnectionStringReader
as scoped service.When no connection string could be found, the
SelectingProcessorAccessor
returns
aConnectionlessProcessor
instead of the previously selected processor.Instantiating a migration runner
// Initialize the servicesvar serviceProvider = new ServiceCollection() .AddLogging(lb =\> lb.AddFluentMigratorConsole()) .AddFluentMigratorCore() .ConfigureRunner( builder =\> builder .AddSQLite() .WithGlobalConnectionString(connectionString) .WithMigrationsIn(typeof(AddGTDTables).Assembly)) .BuildServiceProvider();// Instantiate the runnervar runner = serviceProvider.GetRequiredService\<IMigrationRunner\>();// Run the migrationsrunner.MigrateUp();
This adds the FluentMigrator services to the service collection and
๐ง configures the runner to use SQLite with the given connection string,
announcer and migration assembly.Now you can instantiate the runner using the built service provider and use
its functions.