mirror of
https://github.com/UzixLS/migresia.git
synced 2025-07-19 07:11:28 +03:00
Fix rollback migratioins
This commit is contained in:
@ -108,7 +108,7 @@ rollback(ok, App, Time) ->
|
|||||||
%% Load the transform function on all nodes, see:
|
%% Load the transform function on all nodes, see:
|
||||||
%% http://toddhalfpenny.com/2012/05/21/possible-erlang-bad-transform-function-solution/
|
%% http://toddhalfpenny.com/2012/05/21/possible-erlang-bad-transform-function-solution/
|
||||||
rpc:multicall(nodes(), migresia_migrations, list_all_ups, [App]),
|
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);
|
lists:foreach(fun migresia_migrations:execute_down/1, ToRollBack);
|
||||||
rollback({error, _} = Err, _App, _Time) ->
|
rollback({error, _} = Err, _App, _Time) ->
|
||||||
Err.
|
Err.
|
||||||
|
Reference in New Issue
Block a user