Conversation
… exists
On a brand new database, database/migrations/2026-08-06_add_profile_owner.js
runs before Strapi creates the `profiles` table from the content-type schema,
so `knex.schema.table('profiles', ...)` throws "relation \"profiles\" does not
exist" and the backend crash-loops forever -- docker-compose up never
succeeds against an empty database.
The profile content-type schema already declares `owner_id` as part of its
current shape, so a fresh install doesn't need this migration to do anything;
it only matters for databases created before that field existed. Guard the
migration with hasTable() so it's a no-op on a fresh install and still runs
correctly against an existing database missing the column.
Reproduced against a real Postgres instance (not the sqlite dev default),
via `docker-compose up` on an otherwise-untouched clone.
✅ Deploy Preview for certo canceled.
|
Member
|
Please read through this: https://meatproxy.me/ Not taking time to review this, please avoid opening vibe slop PRs. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a brand new database,
database/migrations/2026-08-06_add_profile_owner.jsruns before Strapi creates theprofilestable from the content-type schema, soknex.schema.table('profiles', ...)throwsrelation "profiles" does not existand the backend crash-loops forever --docker-compose upnever succeeds against an empty database.The
profilecontent-type schema already declaresowneras part of its current shape (src/backend/src/api/profile/content-types/profile/schema.json), so a fresh install doesn't need this migration to do anything -- it only matters for databases created before that field existed.Fix
Guard the migration with
hasTable()so it's a no-op on a fresh install (Strapi creates the table withowner_idalready included) and still runs correctly against an existing database that's missing the column.Test plan
docker-compose upon an otherwise-untouched clone (not the sqlite dev default) -- confirmed the crash-loop and the exact error.🤖 Generated with Claude Code