-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create the admin user as a separate command #233
Conversation
This means the migrations can always be run on startup, meaning the database won't get out of sync with the running application. It also means users who don't set the credential variables in their compose files don't keep creating admin users every time the application starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @tckb What do you think?
It needs some changes. will post soon! |
Cool! good PR 👍 @RealOrangeOne What is the your current requirement? First some thoughts from my side -
Migrations are more or less used for "Settingup" / "preparing" the db and isn't normally required to run on every startup.
setup container is not (read "should not be") required for a production system. I would like to emphasize that the docker-compose as mentioned in the docs, is only meant as a mere starting point.
Current migrations does not create admin/default user every time. Once it is created on the first run, the Instead, I would like to see a separate command for resetting admin password, this would resolve #230 what do you guys think? |
My understanding of migrations is that they configure the DB schema. Should said schema need to change, migrations would need re-running (although they'd only run things required to get from the current state to the new state).
I totally agree, in my setup I avoided the need for a setup container entirely, and it's worked out great, and IMO much easier to comprehend what's going on. Hoping to contribute said process back at some point.
This is the crux of the issue i'm trying to resolve. If you don't setup To avoid the DB schema becoming out of sync (whether forgetfulness or auto update), it'd be handy to run
This feels like a separate requirement, but yes I think that'd solve #230. |
Do you have a branch somewhere showing your WIP? I'm having issues (#243) with the self-hosted setup and am curious if your revised methodology has solved them? |
@tckb Are you recommending changes to this PR? I'm in favour of merging it. For the cloud setup for example we don't want any admin user at all. I would like to be able to run migrations separately without creating an admin user. |
Lets go with it for now. We can figure out any issues later. |
Take this comment with a grain of salt because I have very little idea of what I'm doing haha This change seems to have caused an error for me here's a screenshot of the error that brought me here. I reverted this change locally and have things up and running. I'm not sure what the issue with the change is specifically, though. Thanks a bunch for making this this self-hosted option available. |
This means the migrations can always be run on startup, meaning the database won't get out of sync with the running application. It also means users who don't set the credential variables in their compose files don't keep creating admin users every time the application starts.
I'm hoping at some point we can get to a point where the
setup
container isn't necessary, which is how i've setup plausible myself, but that'll come as a later PR.Looks like the diff is a bit noisy due to trailing space cleanup, sorry!