Skip to content
schambers edited this page Sep 14, 2010 · 15 revisions

There are multiple different ways to execute migrations using the runners. The simplest and most straight forward is from the command line using the migrate.exe tool.

Command Line Runner


Migrate.exe /connection "Data Source=db\db.sqlite;Version=3;" /db sqlite /target your.migrations.dll

NAnt Runner


<?xml version="1.0" encoding="UTF-8" ?>
<project name="fluentmigrator" xmlns="http://nant.sf.net/release/0.85/nant.xsd" default="migrate">
	<loadtasks assembly="../../build/FluentMigrator.NAnt.dll" />

	<target name="migrate" description="Migrate the database to the latest version">
	  	<migrate
	    		database="sqlite"
	    		connection="Data Source=:memory:;Version=3;New=True;"
			namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
	    		target="../../build/FluentMigrator.Tests.dll"
		/>
	</target>

	<target name="migrate-rollback" description="Migrate the database back one version">
	  	<migrate
	    		database="sqlite"
	    		connection="Data Source=:memory:;Version=3;New=True;"
			namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
	    		target="../../build/FluentMigrator.Tests.dll"
			task="rollback"
		/>
	</target>

	<target name="migrate-rollback-all" description="Migrates the database back to original state prior to applying migrations">
	  	<migrate
	    		database="sqlite"
	    		connection="Data Source=:memory:;Version=3;New=True;"
			namespace="FluentMigrator.Tests.Integration.Migrations.Interleaved.Pass3"
	    		target="../../build/FluentMigrator.Tests.dll"
			task="rollback:all"
		/>
	</target>
</project>

MSBuild Runner

Rake Runner

Clone this wiki locally