Created
March 12, 2012 16:16
-
-
Save ioleksiy/2023088 to your computer and use it in GitHub Desktop.
Extending Migrator.NET with logic scopes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Classic usage | |
[Migration(1)] | |
public class Migration001 : Migration | |
{ | |
public void Up() { } | |
public void Down() { } | |
} | |
// Same as classic (scope will be determined automatically => md5(typeof(Migration002).Assembly.GetName().Name)) | |
[Migration(2, null)] | |
public class Migration002 : Migration | |
{ | |
public void Up() { } | |
public void Down() { } | |
} | |
// Using user-friendly migration scope => md5("Module A") | |
[Migration(3, "Module A")] | |
public class Migration003 : Migration | |
{ | |
public void Up() { } | |
public void Down() { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The article http://www.oleksiy.pro/2012/03/12/extending-migratordotnet-with-scopes/