[GH-ISSUE #618] npm run prisma:migrate-dev error #169

Closed
opened 2026-02-26 18:45:41 +03:00 by kerem · 10 comments
Owner

Originally created by @wangwenting-dev on GitHub (Nov 2, 2023).
Original GitHub issue: https://github.com/documenso/documenso/issues/618

Issue Description

init database error: version [last code]
npm run prisma:migrate-dev

prisma:migrate-dev
npm run with:env -- npm run prisma:migrate-dev -w @documenso/prisma

with:env
dotenv -e .env -e .env.local --

@documenso/prisma@1.0.0 prisma:migrate-dev
prisma migrate dev

Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database "test", schema "public" at "127.0.0.1:5432"

Error: P3006

Migration 20230907074451_insert_old_data_into_document_data_table failed to apply cleanly to the shadow database.
Error:
错误: 函数 gen_random_uuid() 不存在
HINT: 没有匹配指定名称和参数类型的函数. 您也许需要增加明确的类型转换.
0: sql_schema_connector::validate_migrations
with namespaces=None
at schema-engine/connectors/sql-schema-connector/src/lib.rs:324
1: schema_core::state::DevDiagnostic
at schema-engine/core/src/state.rs:270

npm ERR! Lifecycle script prisma:migrate-dev failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @documenso/prisma@1.0.0
npm ERR! at location: /home/documenso/packages/prisma

Steps to Reproduce

npm run dx

Expected Behavior

No response

Current Behavior

No response

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

Centos 7.9

Browser [e.g., Chrome, Firefox]

No response

Version [e.g., 2.0.1]

feat/refresh

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
Originally created by @wangwenting-dev on GitHub (Nov 2, 2023). Original GitHub issue: https://github.com/documenso/documenso/issues/618 ### Issue Description init database error: version [last code] npm run prisma:migrate-dev > prisma:migrate-dev > npm run with:env -- npm run prisma:migrate-dev -w @documenso/prisma > with:env > dotenv -e .env -e .env.local -- > @documenso/prisma@1.0.0 prisma:migrate-dev > prisma migrate dev Prisma schema loaded from schema.prisma Datasource "db": PostgreSQL database "test", schema "public" at "127.0.0.1:5432" Error: P3006 Migration `20230907074451_insert_old_data_into_document_data_table` failed to apply cleanly to the shadow database. Error: 错误: 函数 gen_random_uuid() 不存在 HINT: 没有匹配指定名称和参数类型的函数. 您也许需要增加明确的类型转换. 0: sql_schema_connector::validate_migrations with namespaces=None at schema-engine/connectors/sql-schema-connector/src/lib.rs:324 1: schema_core::state::DevDiagnostic at schema-engine/core/src/state.rs:270 npm ERR! Lifecycle script `prisma:migrate-dev` failed with error: npm ERR! Error: command failed npm ERR! in workspace: @documenso/prisma@1.0.0 npm ERR! at location: /home/documenso/packages/prisma ### Steps to Reproduce npm run dx ### Expected Behavior _No response_ ### Current Behavior _No response_ ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] Centos 7.9 ### Browser [e.g., Chrome, Firefox] _No response_ ### Version [e.g., 2.0.1] feat/refresh ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [ ] I have provided steps to reproduce the issue. - [ ] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [ ] I understand that this is a voluntary contribution and that there is no guarantee of resolution.
kerem 2026-02-26 18:45:41 +03:00
  • closed this issue
  • added the
    type: bug
    label
Author
Owner

@Mythie commented on GitHub (Nov 2, 2023):

Hey there, that migration should be able to apply cleanly.

is this for a local development environment or self hosted instance?

<!-- gh-comment-id:1789974913 --> @Mythie commented on GitHub (Nov 2, 2023): Hey there, that migration should be able to apply cleanly. is this for a local development environment or self hosted instance?
Author
Owner

@wangwenting-dev commented on GitHub (Nov 2, 2023):

local development

<!-- gh-comment-id:1789975846 --> @wangwenting-dev commented on GitHub (Nov 2, 2023): local development
Author
Owner

@Mythie commented on GitHub (Nov 2, 2023):

Have you ran previous versions of the application or is this your first time?

<!-- gh-comment-id:1789982640 --> @Mythie commented on GitHub (Nov 2, 2023): Have you ran previous versions of the application or is this your first time?
Author
Owner

@wangwenting-dev commented on GitHub (Nov 2, 2023):

first run

<!-- gh-comment-id:1789984760 --> @wangwenting-dev commented on GitHub (Nov 2, 2023): first run
Author
Owner

@wangwenting-dev commented on GitHub (Nov 2, 2023):

Do databases have version requirements?
my use version postgresql-12

<!-- gh-comment-id:1790130258 --> @wangwenting-dev commented on GitHub (Nov 2, 2023): Do databases have version requirements? my use version postgresql-12
Author
Owner

@wangwenting-dev commented on GitHub (Nov 2, 2023):

not using docker
Usage steps:
1/npm i
2/vim .env update database config
3/npm run prisma:migrate-dev
setup3 out error

<!-- gh-comment-id:1790136657 --> @wangwenting-dev commented on GitHub (Nov 2, 2023): not using docker Usage steps: 1/npm i 2/vim .env update database config 3/npm run prisma:migrate-dev setup3 out error
Author
Owner

@TameemAsim commented on GitHub (Nov 2, 2023):

@wangwenting-dev I think you should use postgresql 15

<!-- gh-comment-id:1790137791 --> @TameemAsim commented on GitHub (Nov 2, 2023): @wangwenting-dev I think you should use postgresql 15
Author
Owner

@Mythie commented on GitHub (Nov 2, 2023):

Yeah I believe we support >= 13 sorry!

the docker compose file will have the tagged version of Postgres 😄

<!-- gh-comment-id:1790148322 --> @Mythie commented on GitHub (Nov 2, 2023): Yeah I believe we support >= 13 sorry! the docker compose file will have the tagged version of Postgres 😄
Author
Owner

@catalinpit commented on GitHub (Nov 2, 2023):

Thanks for reporting this! Please try Postgres 15, and if you have the same issue, feel free to open another issue.

<!-- gh-comment-id:1790184345 --> @catalinpit commented on GitHub (Nov 2, 2023): Thanks for reporting this! Please try Postgres 15, and if you have the same issue, feel free to open another issue.
Author
Owner

@wangwenting-dev commented on GitHub (Nov 2, 2023):

Thank you,After upgrading to Postgres 15, it was successful

<!-- gh-comment-id:1790441725 --> @wangwenting-dev commented on GitHub (Nov 2, 2023): Thank you,After upgrading to Postgres 15, it was successful
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#169
No description provided.