Repository navigation
Keep dev schema push off; fix seeding - #167
Open
anthonysantiago-eng wants to merge 2 commits into
Open
anthonysantiago-eng wants to merge 2 commits into
anthonysantiago-eng wants to merge 2 commits into
Conversation
Running `pnpm dev` on a fresh local database could crash after migrations: Payload's dev-mode schema push saw the audio_files / audio_jobs / transcripts tables (still created by 20260428_100000_add_audio_transcription, but whose collections were removed in 013e0a5) and tried to drop them. It asked whether the enum_audio_jobs_* enums were renamed, then failed with `constraint "payload_locked_documents_rels_audio_files_fk" ... does not exist`, leaving the database partly changed. Migrations are the source of truth for schema, so local dev should run with PAYLOAD_DISABLE_PUSH=1. generate-env.js already writes it for new .env files; older or hand-written ones may be missing it. - scripts/dev-up.sh: warn (without failing) when PAYLOAD_DISABLE_PUSH=1 is not set - docs/local-development.md: setup steps match dev-up.sh; document the push failure and how to rebuild an affected database - docs/migrations.md: removing a collection leaves its tables behind - docs/architecture.md, CLAUDE.md, GEMINI.md: keep the flag set locally - scripts/seed.ts: mark the seeded photo feature's centre framing as intentional so the v1.1.0 focal-point guard no longer aborts the seed before the homepage layout is created No migrations, collection config or production paths are changed.
scripts/seed-sports.ts adds 24 published sports articles across the varsity teams, backdated over the last two months, reusing the fixture photos and sports editor created by `pnpm db:seed`. Articles are matched by slug, so re-running is safe. Saves use the legacyImport context so the backdated publishedDate is kept and no PostHog events or breaking-news pushes fire. docs/local-development.md gains a "Placeholder data" section covering db:seed, seed-sports.ts and what db:fresh does.
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.
Problem
pnpm devon a fresh local DB crashes after migrations. Payload's dev schema push tries to drop the leftoveraudio_*/transcriptstables (collections removed in 013e0a5, tables kept) and fails withconstraint "payload_locked_documents_rels_audio_files_fk" ... does not exist. The DB is left half-changed.Fix
Run local dev with
PAYLOAD_DISABLE_PUSH=1. Migrations own the schema.scripts/dev-up.sh: warns if the flag is missingscripts/seed.ts: fixed; the focal-point guard was aborting itscripts/seed-sports.ts: new, 24 sports articles for local devRisk
None to production. No migrations, config or deploy changes.
Tested
/sportsrenders all articlesDropping the audio tables: #166.