-
Notifications
You must be signed in to change notification settings - Fork 0
FluentMigrator Task
FluentMigrator is a database migration framework for .NET written in C#. The basic idea is that you can create migrations which are simply classes that derive from the Migration base class and have a Migration attribute with a unique version number attached to them. Upon executing FluentMigrator, you tell it which version to migrate to and it will run all necessary migrations in order to bring your database up to that version.
Website: https://github.com/schambers/fluentmigrator
There are four configuration options that are required to run a migration; the path to the console runner executable, the database provider, the target assembly and a connection string to the database.
An example of a migration to the latest version:
desc "FluentMigrator Test Runner Example"
desc "MigrateDb"
fluentmigrator :migrate do |migrator|
migrator.command = 'lib/Migrate.exe'
migrator.provider = 'postgres'
migrator.target = './Migrations/bin/Release/Migrations.dll'
migrator.connection = 'Server=127.0.0.1;Port=5432;Database=FluentMigrator;User Id=test;Password=test;'
migrator.verbose = true
end
You must provide the location of the FluentMigrator console runner executable either through the constructor or via the .command setting.
The kind of database you are migrating against. Available choices are: sqlserver2005, sqlserver2008, sqlserverce, sqlserver, mysql, postgres, oracle, sqlite, jet
The assembly containing the migrations you want to execute.
The connection string to the server and database you want to execute your migrations against.
The task you want FluentMigrator to perform. Available choices are: migrate:up, migrate (same as migrate:up), migrate:down, rollback, rollback:toversion, rollback:all. Default is ‘migrate’.
Show the SQL statements generated and execution time in the console. Default is false.
Output generated SQL to a file. Default is no output (false). Use output_filename to control the filename, otherwise [assemblyname].sql is the default.
The name of the file to output the generated SQL to. The output option must be included for output to be saved to the file.
The namespace contains the migrations you want to run. Default is all migrations found within the Target Assembly will be run.
The number of versions to rollback if the task is ‘rollback’. Default is 1.
Only output the SQL generated by the migration – do not execute it. Default is false.
The specific version to migrate. Default is 0, which will run all migrations.
The profile to run after executing migrations.
Overrides the default SqlCommand timeout of 30 seconds.
The directory to load SQL scripts specified by migrations from.
Displays the console runner’s help menu.
This task supports configuration via an external YAML file. For more information, see the yamlconfig page.
This task supports additional command line options, including a .parameters collection for passing in options that are not directly supported. For more information, see the commandline task options documentation.
- Build-Server Integration
- Command Line Task Options
- Configuration
- Custom Tasks
- Logging Options
- Sample Usages
- Task Arguments and Rakefile Parameters
- YAML Configuration
- ASP.NET Compiler - ASP.Net website compiler
- Assembly Info Generator - generate assembly info dynamically
- CSC - C# compiler
- Exec - Execute arbitrary cmd
- Fluent Migrator - Run FluentMigrator on migration library
- ILMerge - Merge dll/exe-s together
- MSBuild and XBuild - Compile a .sln-file or a MsBuild xml-file
- MSpec - Test using MSpec (machine.specifications)
- MSTest - Test using Microsoft Test Framework
- NAnt - Run a NAnt script
- NChurn - Calculate per-file churn
- NCover Console - Run NCover for tests/library
- NCover Reports - Generate a report from a coverage run
- NDepend - Run NDepend to check static code metrics
- NuGet Install - Install NuGet packages
- NuGet Pack - Create NuGet packages
- NuGet Push - Push NuGet packages to official MS repo
- NuGet Publish - Publish NuGet packages
- NUnit - Test using NUnit
- NuSpec - Generate a NuSpec file
- Output - File copying and template expansion
- PLink - SSH into a remote computer and run a command
- SQLCmd - Run a SQL command as a part of your build process
- UnZip - Unzip a directory
- XBuild - Run XBuild (will be merged into MsBuild)
- XUnit - Test using XUnit
- Zip - Zip a directory or files
- Edit the Wiki Locally - How to edit the wiki without using Github's interface
- How to Build Albacore
- How to Contribute