Repository navigation
Replies: 1 comment
|
This is expected with the current adapter, and the fix is one adapter option. When Payload connects with Your build step then runs Since CI builds the schema from migrations anyway, turn push off there: // payload.config.ts
db: postgresAdapter({
pool: { connectionString: process.env.DATABASE_URL },
push: process.env.CI ? false : undefined, // keep dev push locally
}),GitHub Actions sets One thing to watch: with push off, a migration you forgot to generate shows up in CI as a missing column/table error. That's usually what you want CI to catch. If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I’m running into a workflow issue with Payload in CI (GitHub Actions).
To enable proper e2e testing, I use a fresh Postgres DB container during CI and seed it with some pages, globals, and media. Before seeding, CI runs all migrations. However, when it tries to build the app after seeding, I get this message:
? It looks like you've run Payload in dev mode, meaning you've dynamically pushed changes to your database.This halts the build process and causes CI to fail after a timeout.
I’ve reproduced this locally and noticed that seeding writes a dev row into the payload_migrations table during seeding, though the
payload migrate:createcommand is showing no changes to write. The same happens when running integration tests. My current workaround is to manually remove that row in CI after seeding and testing, but this feels hacky.Is there a better way to handle this? Is this the expected behavior, or am I missing a configuration to prevent the dev row from being created if all migrations are up to date?
Environment:
Payload: 3.68.x
Node: 22.x
Postgres: (17.5-alpine)
Thanks for any advice or best practices!
All reactions