fix: package alpha prisma database#163
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f71cae0deb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Copy Prisma SQLite bootstrap database for alpha App Service auth persistence. | ||
| mkdir -p deploy/prisma | ||
| cp prisma/omnipost.db deploy/prisma/omnipost.db |
There was a problem hiding this comment.
Put the SQLite DB outside the mounted package
This copies the database into the deployment ZIP, but the dev App Service is configured with WEBSITE_RUN_FROM_PACKAGE = "1" and WEBSITES_ENABLE_APP_SERVICE_STORAGE = "false" in infra/terraform/env/dev/main.tf, so Azure mounts wwwroot from the ZIP as a read-only package (per https://learn.microsoft.com/en-us/azure/app-service/deploy-run-package). When /api/auth registers users or writes audit rows through Prisma, SQLite will need to write to this file and will fail instead of providing the intended auth persistence; initialize/copy the DB into a writable persistent location and point DATABASE_URL there instead of packaging it under wwwroot.
Useful? React with 👍 / 👎.
Summary
Why
Alpha App Service auth persistence needs the SQLite database file present in the deployed package when using the current SQLite-backed Prisma setup.
Validation
prisma/schema.prisma