Hi! When self-hosting Phoenix, is there a way to separate the database schema creation from the application? In my scenario, the database user that the application uses does not have write permissions (PostgreSQL), and the schema would be previously created by an external tool. If there's a way for me to get the migrations (so I can run with the other tool) and then configure the app to not run any DDL, that would be ideal. Thanks.
Yes, you can manually apply Phoenix's database migrations using Alembic before starting the application, and then configure Phoenix to skip running migrations at startup. The migration scripts are located in the Phoenix repository under src/phoenix/db/migrations, and you can run them with Alembic as described in the documentation. To prevent Phoenix from running migrations automatically, set the environment variable PHOENIX_DANGEROUSLY_DISABLE_MIGRATIONS (exact name) before starting the app. This allows you to use a database user with only read/write (not DDL) permissions for the running application, as long as the schema is pre-created and up-to-date with the expected version.For more details on manual migration and disabling automatic migrations, see phoenix/db/README.md and PR #6902. Would you like a step-by-step guide for this process?Sources:
- phoenix/db/README.md
- chore: allow migrations to be skipped (PR #6902)
💡 Hint: Mention RunLLM in the thread for followups.
Hi there, does runLLM's solution solve your issue?
If you tell me the right answer to this question, I'll make sure I don't make the same mistake twice!
Feedback
Type the right answer here...
↵ Please 'enter' to submit
Hey Vinicius P., the pattern above would work, but it’s not something we officially support. As the name of the environment variable suggests, it’s not intended to be used by end users, although we could consider supporting it.
