-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] - Default Mix tasks #38
Comments
Sounds good to me, go for it 👍 |
Just so I get this right, I will use the following default values:
Drop task will accept an option --no-schema to destroy only the database. Defaults to false destroying also the schema. Also, to make it easier to detect that the module is an amnesia database, I think we should add an Migrate will probably go in a different PR... |
How would that function be used? |
Much like this line in Mix.Ecto. I can also detect if the module has a defdatabase!/2 function... I guess it is not necessary to introduce a new function... |
Actually I will call metadata and check it returns a |
[x] - Create mix task |
Hello guys, First of, #42 Second, if these new and shiny mix tasks are part of the official readme on the front page, they should also be part of the latest release people get when they install amnesia using hex. So maybe we should create a new release with the current master? |
@matehat released a new version. |
👍 |
I think it would help a lot to have some default mix tasks like create|drop|migrate (same as those found in ecto for easier understanding). Your example of install/uninstall in the README is pretty much what everybody does when starting a project with amnesia INMHO.
We would only need to support something like:
Options I can think of are:
--no-schema
: would not create the mnesia schema--disc
: would create passing the option disc:[node()]--disc-only
: same as above but with disc only on node... and other mnesia options.
To support migrate we could have some behaviour that would export a migrate function and we would receive the user module implementing that function. Again, close to Ecto's idiom.
I was starting out a PR but thought that it would be better to ask for opinions first. What do you think @meh?
The text was updated successfully, but these errors were encountered: