[Bug] relation "xxx" does not exist 服务器端数据库版本使用时报错无relation #4002
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
@BertramRay Hello there! I'm a bot named Dosu, here to help you with bug fixes, questions, and contributions. Let's tackle this issue together! You are encountering "relation does not exist" errors because the necessary database migrations have not been executed. To resolve this, you need to run the database migration scripts on your PostgreSQL instance. This will create the required tables and relations in your database. Here are the steps to fix this:
By setting the environment variables and running the migration scripts, you should be able to resolve the "relation does not exist" errors [1][2][3]. |
Beta Was this translation helpful? Give feedback.
-
The error "relation 'xxx' does not exist" when using the server-side database on Vercel with PostgreSQL is likely due to database migration issues. To resolve this, you need to ensure that all environment variables required for the server-side database are filled in before deployment. This includes the Here are the steps to resolve this issue:
Here is an example of setting the environment variables for Serverless Postgres: # Serverless Postgres DB Url
DATABASE_URL=postgres://username:password@host:port/database
# Specify service mode as server, otherwise it will not enter the server-side database
NEXT_PUBLIC_SERVICE_MODE=server For Node Postgres: # Node Postgres DB Url
DATABASE_URL=postgres://username:password@host:port/database
# Specify Postgres database driver as node
DATABASE_DRIVER=node
# Specify service mode as server, otherwise it will not enter the server-side database
NEXT_PUBLIC_SERVICE_MODE=server After setting these variables, redeploy the latest commit to apply the changes [1]. |
Beta Was this translation helpful? Give feedback.
-
已解决 vercel build command 需要使用命令 |
Beta Was this translation helpful? Give feedback.
-
This issue is closed, If you have any questions, you can comment and reply. |
Beta Was this translation helpful? Give feedback.
已解决
vercel build command 需要使用命令
NODE_OPTIONS=--max-old-space-size=6144 npm run build
而不是NODE_OPTIONS=--max-old-space-size=6144 next build
, 后者才会触发 postbuild 指令,db 迁移指令在 postbuild 指令中