-
Notifications
You must be signed in to change notification settings - Fork 41
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
"Schema :users does not exist" while the DB has been created and migrated #56
Comments
Hello, Looks like Mnesia doesn't use |
Awesome, I'll stay availlable if you have any question. Also, I still pretty new to Elixir, so the code may be a little misorganised and non idiomatic 😅 |
Hello again, I'm doing some testing on the development version, and I am also finding some inconsistency. I have forced my
But then when I show
Since it is the dev version, the DB has been created and migrated via |
So I did have some errors in the script (passing the wrong configuration to the migrator). This should be fixed. But now there is something going on with the host name. Like previously, if I simply run the migration with the default configuration the DB is created with
So it seems that my migration script does not work properly because it does not start the app completely? Maybe I should run the DB migration/creation as part of the "boot" sequence of the app? (No clue if that's a thing BTW ^^) Any idea on how to best solve this? |
After some research I have discovered this demo repository featuring some mnesia migration via RPC instead of running the migration "indepentently". I have adopted the idea and now my DB creation & migration seems to work. It's far from perfect for a general use cases (I see a lot of potential edge cases not covered), but it works for me®. I think what this issue highlight is some missing documentation around the live deployment of a project using ecto_mnesia. I will try to take the time to write down something about deploying with distillery. In the meantime, feel free to close the issue if you prefer :) |
@Mayeu Please go ahead and write out these deployment steps, because we are struggling with exactly the same thing right now! |
@Qqwy Sorry not a priority for me right now! But my project using mnesia is available on GitHub. Here is a direct link to my migration task. Note that this is really a side project I rarely touch, so I can't be sure it is still working with the last version of everything. |
@Mayeu I am almost able to make it work, with the following caveats:
What causes this problem (
vs: (When running from a console)
However, I'm able to run the code from a console connected to the application. |
Hmm... It seems that ecto_mnesia does not properly read out the MNESIA_HOST and MNESIA_STORAGE_TYPE command-line parameters, although they are specified as explained in the README. hard-coding them seems to have made it slightly less problematic to run it. |
Hello 👋,
I am having some trouble when deploying a Phoenix project using ecto_mnesia.
My config is the following:
When I am testing the app everything works great, but trying to deploy fails with an error stating that the :users table is missing:
If I start a console and check the mnesia info I get:
But some info looks weird here:
disc_copies
when my config only define disc copies.:habitibot
atom?You can access the repository here if you want to try directly. The migration code can be found here, and it is based on the one proposed in the Distillery doc.
Any clue what could be happening here?
The text was updated successfully, but these errors were encountered: