-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
db: postgres@payloadcms/db-postgres@payloadcms/db-postgresstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Link to reproduction
No response
Describe the Bug
The Postgres Adapter errors due to missing relations (specifically users, but others error as well when queried using the Local API), either using the Local API or the built nextjs admin panel.
This only errors if next dev has never been run.
I assume running next dev seeds the postgres database so from that point on both the local api, and the admin panel are able to resolve the postgres relations. However this should be able work without seeding the database.
To Reproduce
- Clone and
cdinto payloadcms/payload-3.0-demo - Run
pnpm install - Use Postgres:
// payload.config.ts import { postgresAdapter } from '@payloadcms/db-postgres' export default buildConfig({ // ... db: postgresAdapter({ pool: { connectionString: process.env.POSTGRES_URI || '', }, }) // ... })
- Start the database:
$ ./start-database.sh - Build it:
This already errors because
$ PAYLOAD_SECRET=secret POSTGRES_URI=postgresql://postgres:password@127.0.0.1:5432/next-payload-3 pnpm buildmy-routetries to query the empty postgres database:error: relation "users" does not exist - Remove
my-route:$ rm -rf src/app/my-route - Build it again:
$ pnpm build - Start it:
$ PAYLOAD_SECRET=secret POSTGRES_URI=postgresql://postgres:password@127.0.0.1:5432/next-payload-3 pnpm start - Navigate to http://localhost:3000/admin and receive the same error.
Payload Version
3.0
Adapters and Plugins
db-postgres
Metadata
Metadata
Assignees
Labels
db: postgres@payloadcms/db-postgres@payloadcms/db-postgresstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet