-
Notifications
You must be signed in to change notification settings - Fork 0
Transaction modes for the migration runner
There are two modes, Transaction-Per-Session and Transaction-Per-Migration. The default mode for FluentMigrator is Transaction-Per-Migration.
This mode means that each migration is run in its own transaction and allows selected migrations to be run with no transaction. This allows migrations to be able to do tasks like creating full-text indexes which cannot be run in a transaction.
This mode can be used in combination with the new TransactionBehavior attribute.
[Migration(201304210958, TransactionBehavior.None)]
For this migration it will be run outside of a transaction. The default value for TransactionBehavior is Default which means the migration will be run in a transaction.
Up to this release, there has been one mode, Transaction-Per-Session. This means that if two migrations or more migrations are run together during the same task (e.g. migrate up or down) then this occurs in the same transaction and if one of the migrations fails then all the migrations are rolled back.
Transaction-Per-Session is the old default and if you want to use this mode then there are switches for the Command-Line runner, Nant runner and MSBuild runner to enable it.
- Getting FluentMigrator
- How to create a Migration
- Fluent Interface
- Migration Runners
- Use inbuilt database functions when setting the default value
- Sql Server Specific Extensions
- Raw Sql Helper for inserting data
- Auto Reversing Migrations
- Resharper File Template
- Transaction Modes for the Migration Runner
- ApplicationContext: Passing parameters to Migrations
- Dealing with Multiple Database Types
- Filter migrations run based on Tags
- Enforce migration version numbering rules
- Create custom metadata for the VersionInfo table