KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am attempting to get migrations working with my project using fluent migrator. But due to the lack of documentation I am struggling to figure out how to rollback and have the Down method called for my migration class. I set up the db with an initial version 1 class: [Migration(1)] public class Baseline : Migration { public override void Up() { Execute.Script("1_Baseline\\baseline.sql"); } public override void Down() { } } I am running migrations via a batch file containing the following: "....\tools\fluentmigrator\migrate.exe" --connection "Data Source=.\sqlexpress;Initial Catalog=ekmDomains;Integrated Security=true;multipleactiveresultsets=true;" --db SqlServer2005 --target "bin\Release\EkmDomains.Migrations.dll" This works fine. So I then wrote a second migration class just to test it out: [Migration(2)] public class AddNewTable : Migration { public override void Up() { Create.Table("NewTable").WithColumn("name").AsString(); } public override void Down() { Delete.Table("NewTable"); } } Again after running the batch file, everything works ok. I then looked at the command line options for the fluent migrator tool, and saw a --version option. I assumed that to rollback to a previous version I would simply supply --version 1 and the Down of AddNewTable would be called. That, however, did not happent. The console simply displays a 'committing transaction` method then closes. But the table has not been deleted and the version number hasn't changed. Am I doing this the wrong way or can anyone see some fundamental flaw in how I am doing this?
Tags (comma-separated)
Save Edits
Cancel