.net - FluentMigrator migration succeeds, but no changes to DB -
i must missing pretty basic.
i'm working on legacy project, , i'm trying bring fluentmigrator mix cause i've got interesting database changes , data migrations coming think made easier using tool.
for initial migration, want bring database current production version, as-is. simplify initial migration, scripted out sql server 2008 database, , migration executes scripted commands series of sql commands.
to test out, create entirely empty database, , try run command line using this:
> migrate -a "c:\my\project\path\bin\debug\rds.myprojname.dbmigrations.dll" -db sqlserver2008 -conn "data source=.\sqlexpress2008;initial catalog=mynewdbname; integrated security=sspi" -version=20100901000000
the version specified timestamp on first migration class's migration attribute.
at command line, appears run fine - the entire script zooms by, , ends with:
-- createproductiondbcircasep2010: migrated
however, when take @ database, still empty. absolutely nothing in there. method looks this:
public override void up() { var cmds = loadembeddedresources .getembeddedresource("scripted_db_2010-09-01.sql") .asstring() .parsecommands(); foreach (var c in cmds) { execute.sql(c); } createreferencedata(); }
(fyi, i'm parsing script instead of running as-is because started using migrator.net before discovering dead, , set up.)
can give me hand? appears transaction isn't committing, or command-line option have migration dry- run turned on, don't see it...
edit:additional things i've tried
to confirm connection string using database expect to, renamed database , afterwards got login error, expected.
for further tests, cut down length of script, , tried executing using
public override void up() { execute.script(@"..\resources\test.sql"); }
instead of command-by-command, same results. here output on test (note, edited pathes , such):
c:\my\project\path\fluentmigrator.net\ >migrate -a "c:\my\project\path\bin\debug \my.project.dbmigrations.dll" -db sqlserver2008 -conn "data source=.\sqlexpress2 008;initial catalog=mynewdbname;integrated security=sspi" -version=2010090100000 0 using database sqlserver2008 , connection string data source=.\sqlexpress2008; initial catalog=mynewdbname;integrated security=sspi -- versionmigration: migrating =============================================== -- createtable versioninfo -- versionmigration: migrated -- createproductiondbcircasep2010: migrating ================================= -- executesqlscript c:\my\project\path\fluentmigrator.net\..\resources\test.sql -- createproductiondbcircasep2010: migrated
yet no tables in database - there isn't expected versioninfo table.
after investigation , testing both version 0.8 , 1.0, appears bug in fluentmigrator.net related migration runner's transaction management - if run migration specific version number, transaction's commit never gets called; if don't specify version number, it's fine.
edit:
i have since submitted patch project accepted. no longer problem.
Comments
Post a Comment