Skip to content

Commit

Permalink
Enhancement - Allow for one time script to run (chucknorris/roundhous…
Browse files Browse the repository at this point in the history
…e#35). Fix - Don't run scripts that have already been run and not modified (chucknorris/roundhouse#42)
  • Loading branch information
ferventcoder committed Jan 7, 2012
1 parent 69ae641 commit 905d3ef
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions product/roundhouse/migrators/DefaultDatabaseMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,18 @@ private bool this_script_should_run(string script_name, string sql_to_run, bool
return true;
}

if (this_script_has_run_already(script_name) && run_this_script_once)
{
return false;
}

if (is_running_all_any_time_scripts && !run_this_script_once)
{
return true;
}

return this_script_has_changed_since_last_run(script_name, sql_to_run);
if (this_script_has_run_already(script_name)
&& !this_script_has_changed_since_last_run(script_name, sql_to_run))
{
return false;
}

return true;
}

public bool this_is_an_environment_file_and_its_in_the_right_environment(string script_name, Environment environment)
Expand Down

0 comments on commit 905d3ef

Please sign in to comment.