Skip to content

Instantly share code, notes, and snippets.

@ioleksiy
Created March 12, 2012 16:16
Show Gist options
  • Save ioleksiy/2023088 to your computer and use it in GitHub Desktop.
Save ioleksiy/2023088 to your computer and use it in GitHub Desktop.
Extending Migrator.NET with logic scopes
// 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() { }
}
@ioleksiy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment