#Running migrations in Vercel?

1 messages · Page 1 of 1 (latest)

valid zephyr
#

Hi all, I have a blank payload project created today using create-payload-app

I have set up a git deployment to Vercel, and a Neon postgres database through Vercel. I have set up all the environment variables etc through Vercel. I have also set up a second Neon postgres instance for my local environment, to check everything works. Set up the same way with Vercel handling the env variables.

When I run locally and visit the /admin endpoint it works as I would expect and prompts me to create my first user.

When I try and visit the admin endpoint on the deployed version I get a server error and the following in my server logs:

error: relation "users" does not exist
    at <unknown> (.next/server/chunks/5909.js:188:29265)
    at async (.next/server/chunks/5909.js:195:17992)
    at async t0 (.next/server/chunks/5909.js:91:1625)
    at async Object.ii [as findOne] (.next/server/chunks/5909.js:91:5316)
    at async ej (.next/server/app/(payload)/admin/[[...segments]]/page.js:64:25874) {
  length: 105,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '156',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1392',
  routine: 'parserOpenTable',
  digest: '1617028735'
}

I have since run payload migrate:create and commited the migrations to the repo, but the error still persists.

Do I need to configure Vercel to run my migrations? If so how and where/when should I be doing this.

Thanks in advance.

glossy graniteBOT