-
Notifications
You must be signed in to change notification settings - Fork 63
Fluent Migrator
FluentMigrator is a database migration framework for .NET written in C#.
desc "Migrate db to latest version"
fluentmigrator :migrate => [:build] do |cmd|
cmd.command = "path/to/migrate"
cmd.provider = "postgres"
cmd.target = "path/to/migrations"
cmd.connection = "Server=localhost;Port=5000;Database=Fluentm"
cmd.verbose
endThe location of the console runner executable.
command = "path/to/migrate"The kind of database you are migrating: sqlserver2005, sqlserver2008, sqlserverce, sqlserver, mysql, postgres, oracle, sqlite, jet
provider = "postgres"The assembly containing the migrations you want to execute.
target = "path/to/migrations"The connection string to the server and database you want to execute your migrations against.
connection = "Server=localhost;Port=5000;Database=Fluentm"The task you want FluentMigrator to perform: migrate, migrate:up, migrate:down, rollback, rollback:toversion, rollback:all. The default is migrate.
task = "migrate"Show the SQL statements generated and execution time in the console.
verboseOutput generated SQL to a file. Use the output filename to control the filename, otherwise <assemblyname>.sql is the default.
out
out_file = "path/to/generated/sql"The namespace that contains the migrations to run. The default is all the migrations found within the target assembly.
namespace = "Foo.Something"The number of versions to rollback if the task is rollback. The default is 1.
steps = 10Only output the SQL generated by the migration - do not execute it.
previewThe specific version to migrate. The default is 0, which will run all migrations.
version = 99The profile to run after executing migrations.
profile = "Whatever"Overrides the default SqlCommand timeout of 30 seconds.
timeout = 90The directory to load SQL scripts specified by migrations from.
script_directory = "db/migrations"(none)