Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级失败 #140

Open
jkjoy opened this issue Jan 6, 2025 · 3 comments
Open

升级失败 #140

jkjoy opened this issue Jan 6, 2025 · 3 comments

Comments

@jkjoy
Copy link

jkjoy commented Jan 6, 2025

Error: P3009  25/01/06 08:53:31errormigrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve  25/01/06 08:53:31errorThe `20240516050303_init` migration started at 2024-12-23 00:50:47.313267 UTC failed  25/01/06 08:53:31errorELIFECYCLE  Command failed with exit code 1.  25/01/06 08:53:31errorELIFECYCLE  Command failed with exit code 1.  25/01/06 08:53:31errorELIFECYCLE  Command failed with exit code 1.

貌似是迁移数据库失败,这是什么问题呢

@moonrailgun
Copy link
Contributor

looks first migration has been failed.
can you check your database link is right and check database table _prisma_migrations?

@jkjoycn
Copy link

jkjoycn commented Jan 23, 2025

looks first migration has been failed. can you check your database link is right and check database table _prisma_migrations?

[email protected] start:docker /app/tianji
pnpm start:docker:db && pnpm start
[email protected] start:docker:db /app/tianji
cd src/server && pnpm db:migrate:apply && pnpm db:migrate:script
@tianji/server@ db:migrate:apply /app/tianji/src/server
prisma migrate deploy
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "tianji", schema "public" at "jkjoy-pg-cs13mq:5432"
43 migrations found in prisma/migrations
Error: P3009
migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
The 20240516050303_init migration started at 2024-12-23 00:50:47.313267 UTC failed
ELIFECYCLE  Command failed with exit code 1.
ELIFECYCLE  Command failed with exit code 1.
ELIFECYCLE  Command failed with exit code 1.

@moonrailgun
Copy link
Contributor

ok, i think here is some problem when migration. you can:

  • check database migration sql one by one
  • check database's _prisma_migrations table, if normal, its should have much record.
  • if you have no more idea. export all data, clear table, run migration sql to rebuild database struction, and import data again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants