1
0
mirror of https://github.com/UzixLS/migresia.git synced 2025-07-18 23:01:21 +03:00

Fix rollback migratioins

This commit is contained in:
Grzegorz Junka
2015-03-02 18:00:37 +00:00
parent 992564afd9
commit 1d15841d73

View File

@ -108,7 +108,7 @@ rollback(ok, App, Time) ->
%% Load the transform function on all nodes, see:
%% http://toddhalfpenny.com/2012/05/21/possible-erlang-bad-transform-function-solution/
rpc:multicall(nodes(), migresia_migrations, list_all_ups, [App]),
ToRollBack = lists:reverse([X || {_, Ts, _} = X <- Ups, Ts > Time]),
ToRollBack = lists:reverse([X || {_, Ts} = X <- Ups, Ts > Time]),
lists:foreach(fun migresia_migrations:execute_down/1, ToRollBack);
rollback({error, _} = Err, _App, _Time) ->
Err.