Fix fresh PostgreSQL initialization without manual baselining #182
Labels
No labels
auth
autorelease: pending
autorelease: tagged
bug
dependencies
devops
docker
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
javascript
maintenance
question
refactor
ui
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gitchegumi/GitchAlerts#182
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal and deployment hold
Make GitchAlerts usable by self-hosters who supply an empty PostgreSQL database: the documented normal startup must initialize the schema without manual Prisma baselining. Existing installations must continue to upgrade safely.
The owner requested that dev deployment testing remain paused until this fix is completed, released upstream, and incorporated into the Homelab/GitchAlerts deployment bundle. Implementation will be done by the owner in a separate project. This issue tracks the application fix and the downstream bundle follow-through; it does not authorize a production cutover or database reset.
Confirmed defect in v0.12.2
Upstream source: https://git.gitchegumi.com/gitchegumi/GitchAlerts
Prisma applies migration directories in name order. The earliest migration, 20250608000000_add_linked_accounts, creates linked_accounts and adds a foreign key referencing users(id). The initial migration directory is dated 20260531230000, so it runs later. A completely empty database does not have users when that foreign key is applied.
The bundle runs prisma migrate deploy before starting application services. Its current migration runbook works around this by creating the current schema with db push and marking historical migrations applied, only for a verified-empty dev database. Ordinary self-hosters should not need this procedure.
The ordering defect was verified from the v0.12.2 source. Audit and execute the entire migration sequence: do not assume fixing this first failure proves every later migration works. This issue does not claim a new live empty-database failure was reproduced during issue creation.
Scope
The solution should work for ordinary self-hosted/Compose installs as well as UDS. Avoid making this a Kubernetes-only workaround.
Acceptance tests
Release and bundle follow-through
Deployment hold and downstream tracking
Dev deployment testing is paused at the owner’s request until the upstream fix is released and the deployment bundle consumes it. Dev is intended to start with an empty database; restoring production data is not a substitute for fresh-install coverage. End-to-end dev acceptance remains pending.
Originally filed in the bundle repository as Homelab/GitchAlerts#9; this source-repository issue supersedes it. Downstream migration tracking: Homelab/GitchAlerts#1 and Homelab/platform#28.