1
0
mirror of https://github.com/UzixLS/migresia.git synced 2025-07-19 07:11:28 +03:00

Fixing the template for generated templates; forgot a period.

This commit is contained in:
Christopher Phillips
2013-11-19 11:53:41 -05:00
parent 62f6fb3142
commit f28ce61ad3
2 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,7 @@ create_new_migration(App, Description) ->
Filename = lists:flatten(io_lib:format("~w~2.2.0w~2.2.0w~2.2.0w~2.2.0w~2.2.0w_", [Year, Month, Day, Hour, Minute, Second]) ++ Description), Filename = lists:flatten(io_lib:format("~w~2.2.0w~2.2.0w~2.2.0w~2.2.0w~2.2.0w_", [Year, Month, Day, Hour, Minute, Second]) ++ Description),
FullPathAndExtension = filename:join(migresia_migrations:get_priv_dir(App), Filename ++ ".erl"), FullPathAndExtension = filename:join(migresia_migrations:get_priv_dir(App), Filename ++ ".erl"),
io:format("Creating new migration: ~p~n", [FullPathAndExtension]), io:format("Creating new migration: ~p~n", [FullPathAndExtension]),
file:write_file(FullPathAndExtension, io_lib:fwrite("-module(~p).~n-behavior(db_migration).~n-export([up/0, down/0]). ~n~nup() -> ok.~n~ndown() -> throw(<<\"Downgraders not implemented.\">>)", [list_to_atom(Filename)])), file:write_file(FullPathAndExtension, io_lib:fwrite("-module(~p).~n-behavior(db_migration).~n-export([up/0, down/0]). ~n~nup() -> ok.~n~ndown() -> throw(<<\"Downgraders not implemented.\">>).", [list_to_atom(Filename)])),
io:format("Migration written.~n~n"). io:format("Migration written.~n~n").
-spec check(atom()) -> any(). -spec check(atom()) -> any().

View File

@ -48,6 +48,7 @@ get_priv_dir(App) ->
get_migrations({error, _} = Err) -> get_migrations({error, _} = Err) ->
exit(Err); exit(Err);
get_migrations(Dir) -> get_migrations(Dir) ->
io:format("DIR: ~p~n~n", [Dir]),
ToApply = check_dir(file:list_dir(Dir)), ToApply = check_dir(file:list_dir(Dir)),
start_mnesia(), start_mnesia(),
Applied = check_table(), Applied = check_table(),