-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Run db migrations prior to first startup #9177
Comments
I think the hardcoded @jrasm91 thoughts? |
I agree, poking the database directly is not a great idea, so far was just the only way to pre-setup this on behalf of the user. Does immich have an API which can be used on localhost without access tokens where we could just call the openid settings endpoint (and potentially other things)? Or would this be more the job for the |
I was not aware of a use case to manually run migrations through this command outside of development. We can make it possible to run against another host, but relying on it seems like a recipe for future issues. There is an API for setting and updating the configuration so maybe it is worth looking into a way to leverage the instead. |
Ideally we don't want to run the database migration manually up front. This is really only needed as the OpenID auth settings are pre-provisioned for the user on Cloudron to have SSO across many apps installed on a server. Maybe to circumvent the database migration/app bootstrapping issue, does Immich have a way to pre-provision certain settings, like picking up those values from env variables instead of the database if provided? Briefly looked through the code but didn't catch anything like that. |
There is the config file, but I don't know whether that works for you as it fully locks the settings UI. |
Actually I didn't realize an optional config file exists. This solves it nicely for our use-case. Thanks a lot for pointing me in the right direction, sorry for the distraction. For others https://immich.app/docs/install/config-file is the docs link. |
The bug
Since 1.103.0 with https://github.com/immich-app/immich/pull/9118/files it seems one cannot run
npm run typeorm:migrations:run
anymore prior to the startup of the main app or at least it will use the hardcodedlocalhost
for the postgres database.For the Cloudron app package we need to configure some OpenID specific values in the database during app startup, which then naturally fails as tables don't exist yet on a fresh installation. Since we don't quite know once the main app startup has finished with the database migrations, we can't run those reliably now.
Is there any workaround for this or are we missing some other cli command to run migrations the same way the main app startup does but then exit after those have been run?
The OS that Immich Server is running on
Cloudron/Ubuntu
Version of Immich Server
v1.103.0
Version of Immich Mobile App
v1.103.0
Platform with the issue
Your docker-compose.yml content
does not apply
Your .env content
Reproduction steps
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: