All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Runner: Default schema name can be set (PR #907)
- Stripping comments can be disabled (which will become the default in 4.x, Issue #956, PR #925)
WithGlobalConnectionStringaccepting a lambda for lazy connection string query (PR #919)- New Oracle 12c support
- Identity generator options (PR #921)
- Maximum name length increased to 128 (PR #940)
- Identity generator options (PR #921)
- Disable quoted names for PostgreSQL (Issue #958, PR #961)
- Implemented by setting
PostgresOptions.ForceQuotetofalse - Can be set with the provider option
Force Quote=false - Default behaviour is
Force Quote=true
- Implemented by setting
- PostgreSQL: Added XML type (Issue #950, PR #995)
- Migration conditions (Issue #838, PR #990)
- New attribute:
CurrentVersionMigrationConstraintto ensure that this migration only gets run when the database version is greater or equal than the given number. This allows some kind of migrations that will only be executed when a conversion is necessary.
- New attribute:
- Allow loading of maintenances without tags (Issue #983, PR #984)
- SQL Server 2008: SPARSE column option (PR #946)
IConventionSetloaded from given assemblies (Issue #916)
- Clarification remark for
RunnerOptions.StartVersion(PR #992)
- Oracle: Fixed preview mode (PR #920, #926)
- SQL Server CE: Fixed preview mode (PR #920, #926)
- SQLite: Fixed byte array parameters (PR #943)
- SQL Anywhere uses
//instead of#for comments (Issue #859) - SQL Server: Don't use
#for comments (Issue #859) - SQLite: Don't use
#for comments (Issue #859) - PostgreSQL: Description generator now works with set default schema name. (Issue #971, #1000, PR #999)
- Don't open transaction for preview (Issue #957)
- Transaction is now always passed to
Execute.WithConnectiondelegate (Issue #1001)
- Alegrowin
- coryalbert
- dfaruque
- EBMSPTYLTD
- elken
- groogiam
- hansehe
- igitur
- Jogge
- jzabroski
- PhenX
- poimis
- TerraVenil
- zamoa
- Migration loader doesn't try to load profiles anymore (fixes #904)
- Avoid duplicate Dispose calls (fixes #901)
- The FluentMigrator.Console package doesn't depend on the FluentMigrator package, because it's already included
- New
IFilteringMigrationSourceto avoid unnecessary instantiations - New
IVersionTableMetaDataSourceItemto specify multiple places to search for version table metadata dotnet-fmandMigrate.exeare now referencingFSharp.Corewhich should ease the problems with F# (issue #883).- New configuration for types from assemblies (see below)
- #877: Connection specific information should be resolved as scoped
- #884: Embedded script cannot be found in assemblies on .NET Core
- #888: VersionTable not changed after upgrading to 3.0
- Query
IConfigurationRootfor the connection string ifIConfigurationcouldn't be found
- #886: Using profiles in 3.x versions
- #892: Nullable types are not supported in MSBuild runner
- #890: OracleManaged Migrations fail with runtime Exceptions
Oracle plans to release a non-beta version of the driver in Q3, but
it's the only Oracle driver that works under Linux/MacOS. The console
tool (Migrate.exe) is more Windows-centric and will therefore keep
using the standard Oracle ADO.NET library. The dotnet-fm is mostly
used on non-Windows platforms and is therefore predestinated to use
the new beta driver.
The statement from Oracle can be found on the Oracle website.
The console tool will switch to the new driver when it becomes stable.
var services = new ServiceCollection()
.AddFluentMigratorCore()
.ConfigureRunner(rb => rb
.AddSQLite()
.ScanIn(typeof(YourType).Assembly));
// There is a fluent interface to configure the targets for ScanInConfigurations for ScanIn(assemblies):
--+-------------------------------------------+->
| ^
| |
+- For -+- All() ---------------------------+
^ | ^
| | |
| +- Migrations() ------------+-->+-->+
| | ^ |
| | | |
| +- VersionTableMetaData() --+ |
| | ^ |
| | | |
| +- EmbeddedResources() -----+ |
| |
| v
+<--------------------------------------+
Example:
var services = new ServiceCollection()
.AddFluentMigratorCore()
.ConfigureRunner(rb => rb
.AddSQLite()
.ScanIn(typeof(YourType).Assembly)
.For.Migrations()
.For.EmbeddedResources());
// There is a fluent interface to configure the targets for ScanInThis allows the reconfiguration of the connection string/used database at run-time.
- Connection string
- Processor/generator selection
- Type filters
The following option classes are now resolved using IOptionSnapshot<T>:
ProcessorOptionsSelectingProcessorAccessorOptionsSelectingGeneratorAccessorOptionsTypeFilterOptions
The following services are now scoped instead of singleton:
IVersionTableMetaDataAccessorIVersionTableMetaDataIMigrationSourceIMigrationInformationLoader
The MigrationSource now consumes all registered IMigrationSourceItem instances.
The new documentation is online on https://fluentmigrator.github.io.
- #850: Set minimum .NET Framework version to 4.6.1. Older versions aren't supported anymore.
ProcessorOptions.Timeoutis now of typeSystem.TimeSpan?MigrationRunner.MaintenanceLoaderis now read-onlyMigrationRunner.CaughtExceptionsreturns now aIReadOnlyListdotnet-fmis now a global tool and requires at least the .NET Core tooling 2.1-preview2
- #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
IConfigurationservice (Microsoft.Extensions.Configuration) - #822:
IMigrationExpressionValidatorfor custom migration expression validation - #809: Ability to add a schema owner during schema creation for SQL Server
- #767: Append
NULLconstraint for custom types for PostgreSQL and SQL Server
IAssemblyCollectionand all its implementationsIAnnouncerand all its implementationsIMigrationRunnerConventions.GetMigrationInfoIProfileLoader.ApplyProfiles()IProfileLoader.FindProfilesInIMigrationProcessorOptionsIMigrationProcessorFactoryand all its implementationsIRunnerContextandRunnerContext, replaced by several dedicated options classes:RunnerOptionsare the newRunnerContext(minus some properties extracted into separate option classes)ProcessorOptionsfor global processor-specific optionsGeneratorOptionsto allow setting the compatibility modeTypeFilterOptionsfor filtering migrations by namespaceAnnouncerOptionsto enable showing SQL statements and the elapsed timeSelectingProcessorAccessorOptionsallows selection of a processor by its identifierSelectingGeneratorAccessorOptionsallows selection of a generator by its identifierAppConfigConnectionStringAccessorOptionsto allow leading the connection strings from the *.config xml file (deprecated, only for transition toMicrosoft.Extensions.Configuration)
CompatabilityMode(is nowComatibilityMode)ApplicationContextin various interfaces/classesManifestResourceNameWithAssemblyreplaced byValueTupleMigrationGeneratorFactoryMigrationProcessorFactoryProviderITypeMap.GetTypeMap(DbType, int, int)IDbFactory: Only the implementations will remain- Several non-DI constructors
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
IConnectionStringReaderimplementations- 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 no reader returned a connection string, then return
ProcessorOptions.ConnectionString
The connection string stored in ProcessorOptions.ConnectionString might be overridden
by registering the IConnectionStringReader instance PassThroughConnectionStringReader
as scoped service.
When no connection string could be found, the SelectingProcessorAccessor returns
a ConnectionlessProcessor instead of the previously selected processor.
// Initialize the services
var serviceProvider = new ServiceCollection()
.AddLogging(lb => lb.AddFluentMigratorConsole())
.AddFluentMigratorCore()
.ConfigureRunner(
builder => builder
.AddSQLite()
.WithGlobalConnectionString(connectionString)
.WithMigrationsIn(typeof(AddGTDTables).Assembly))
.BuildServiceProvider();
// Instantiate the runner
var runner = serviceProvider.GetRequiredService<IMigrationRunner>();
// Run the migrations
runner.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.
- #856 New constructors to enable passing a custom expression convention set
- #859: The pound sign is only recognized when it's only preceeded by whitespace
- net452 build for the console runner to enable usage of the latest MySQL ADO.NET provider
- Added more ADO.NET providers for the console
- The tools are in platform-specific sub-directories again (e.g.
tools/net452/x86/Migrate.exe)
This has become necessary to enable a better out-of-the-box experience for the migration tool.
Unlisted due to unintentional breaking change.
- #858: Don't even try to set the command timeout for SQL Server CE
- #856: Don't fail when an assembly couldn't be loaded
- #848:
MySql4ProcessorFactoryused theMySql5Generator
FluentMigrator.Consolenow contains the migration tool in thetools/directory
- Obsolete
FluentMigrator.Toolspackage added as upgrade path
IQuerySchema.DatabaseTypenow returnsSqlServer2016, etc... and notSqlServerany more- Database specific code was moved into its own assemblies
IMigrationConventionswas renamed toIMigrationRunnerConventionsIMigrationContextdoesn't contain theIMigrationConventionsany more- Expression conventions are now bundled in the new
IConventionSet
- Expression conventions are now bundled in the new
ICanBeConventionalwas removed during the overhaul of the expression convention system- Strings are now Unicode by default. Use
NonUnicodeStringfor ANSI strings FluentMigrator.Toolswas split into the following packagesFluentMigrator.Console: TheMigrate.exetoolFluentMigrator.MSBuild: The MSBuildMigratetask
- Framework: .NET Standard 2.0 support
- Database:
- SQL Anywhere 16 support
- SQL Server 2016 support
- MySQL:
ALTER/DROP DEFAULTvalue support
- MySQL 5:
- New dialect
NVARCHARforAsString
- SQL Server 2005
WITH (ONLINE=ON/OFF)support- 64 bit identity support
- Redshift (Amazon, experimental)
- Firebird
- New provider option:
Force Quote=trueto enforce quotes
- New provider option:
- All supported databases
- Streamlined table/index schema quoting
- Unique Constraints: Non-Distinct NULL support (SQL Server 2008 and SQL Anywhere 16)
- Types: DateTime2 support
- Dialect: SQLite foreign key support
- Insert/Update/Delete: DbNull support
- Expression:
- IfDatabase: Predicate support
- IfDatabase: Method delegation support
- Index: Creation with non-key columns
- Conventions: Default schema name support
SetExistingRowsTosupportsSystemMethods- Passing arguments to embedded SQL scripts
- Runner:
- TaskExecutor: HasMigrationsToApply support
- Case insensitive arguments support
StopOnErrorflag
- Project:
- Moving database specific code from
FluentMigrator.RunnertoFluentMigrator.Runner.<Database> - Extension methods for - e.g. SqlServer - are now in
FluentMigrator.Extensions.SqlServer
- Moving database specific code from
- Database:
- MySQL: Now announcing SQL scripts
- Runner:
- Better error messages
- ListMigrations: showing
(not applied)for unapplied migrations - Show
(BREAKING)for migrations with breaking changes - MSBuild task is available as separate package (with custom .targets file)
- Use provider default command timeout when no global timeout is set
- Generic:
IAnnouncer.Write
- Generic:
- Deprecated functions
- SchemaDump experiment
- T4 experiment
- Framework:
- .NET Framework 3.5 support
- Runner:
- NAnt build task
- Runner:
- Match
TagAttributeby inheritance
- Match
- Processors (database specific processing of expressions):
- Using the new
SqlBatchParserto parse batches of SQL statements (GOstatement support)
- Using the new
- Database:
- Hana: Fixed syntax for dropping a primary key
- Oracle: Table schema now added more consistently
- Tests:
- Mark integration tests as ignored when no active processor could be found