yoonka / migresia

A simple Erlang tool to automatically migrate Mnesia databases between versions
BSD 2-Clause "Simplified" License
25 stars 6 forks source link

Unable to find migresia:create_new_migration/2 #4

Open pjkCochin opened 8 years ago

pjkCochin commented 8 years ago

migresia:create_new_migration/2 is not listed in the exported functions. How do we use this? Please help!

amiramix commented 8 years ago

Right, this REDME describes an older version of the API. The API has changed. Sorry about that. Instead of an API call there is a script in the migresia/priv folder. You simply execute this script and it produces for you a migration from the template:

g@crayon2:~/work % git clone https://github.com/yoonka/migresia
Cloning into 'migresia'...
remote: Counting objects: 140, done.
remote: Total 140 (delta 0), reused 0 (delta 0), pack-reused 140
Receiving objects: 100% (140/140), 31.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (77/77), done.
Checking connectivity... done.

g@crayon2:~/work % cd migresia/priv/

g@crayon2:~/work/migresia/priv % ./new_migration.esh test
Creating new migration: '"20160311114932_test.erl"'
Done.

g@crayon2:~/work/migresia/priv % l
total 14
-rw-r--r--  1 g  g    202 11 Mar 11:49 20160101112233_empty.erl
-rw-r--r--  1 g  g    118 11 Mar 11:49 20160311114932_test.erl
-rwxr-xr-x  1 g  g  1,580 11 Mar 11:49 new_migration.esh

I will keep this issue open until I update the README. Thanks for pointing it out!

pjkCochin commented 8 years ago

Thank You

pjkCochin commented 8 years ago

Also, is there an implementation of downgrades yet?

amiramix commented 8 years ago

Yeah, both up and down migrations work without problems. lostcolony implemented the downgrades initially and since then I reimplemented them to only compile the already applied migrations.