question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression in prisma migrate

See original GitHub issue

I’ve noticed a regression in Prisma migrate. It worked fine in version 2.16, but later versions seem to have this issue.

Ran with version 2.19.0

: prisma migrate dev
Running node v14.16.0 (npm v6.14.11)
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "reviews.sqlite" at "file:../reviews.sqlite"

⚠️  Warnings:

  • You are about to drop the column `vendor` on the `products` table, which still contains 16 non-null values.

✔ Are you sure you want create and apply this migration? Some data will be lost. … yes
✔ Name of migration … remove vendor
Error: Database error: Timed out during query execution.
   0: migration_core::commands::apply_migrations::Applying migration
           with migration_name="20210401145435_remove_vendor"
             at migration-engine/core/src/commands/apply_migrations.rs:72
   1: migration_core::api::ApplyMigrations
             at migration-engine/core/src/api.rs:75

After rolling back to version 2.16.0. I can re-run the same migration without error.

: npx prisma migrate dev --preview-feature
Running node v14.16.0 (npm v6.14.11)
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "reviews.sqlite" at "file:../reviews.sqlite"

The following migration(s) have been applied:

migrations/
  └─ 20210401145435_remove_vendor/
    └─ migration.sql


Everything is now in sync.

Bug description

Prisma migrate fails with a timeout error

How to reproduce

Modify an existing table with prisma migrate.

Environment & setup

  • OS: Ubuntu
  • Database: SQLite
  • Node.js version: 14
  • Prisma version: 2.16, 2.19

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
internalfxcommented, Apr 1, 2021

Tried it again with prisma 2.20.1

I tried adding the column back. Basically, prisma migrate is completely broken for versions > 2.16

: prisma migrate dev
Running node v14.16.0 (npm v6.14.11)
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "reviews.sqlite" at "file:../reviews.sqlite"

✔ Name of migration … add vendor
Error: Database error
Timed out during query execution.
   0: migration_core::commands::apply_migrations::Applying migration
           with migration_name="20210401155700_add_vendor"
             at migration-engine/core/src/commands/apply_migrations.rs:71
   1: migration_core::api::ApplyMigrations
             at migration-engine/core/src/api.rs:73
1reaction
pantharshit00commented, May 28, 2021

Thanks for the reproduction repo @internalfx . I can confirm this.

(Internal note: For reproduction, clone the repo and run migrate).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma Migrate | Database, Schema, SQL Migration Tool
Prisma Migrate is a database migration tool available via the Prisma CLI that integrates with Prisma schema for data modeling.
Read more >
How to Perform Linear Regression in Prism - YouTube
Learn the steps required to perform linear regression analysis in Prism. This video covers how to select the appropriate analysis choices, ...
Read more >
Multiple Logistic regression-use layouts, multiple ... - YouTube
Multiple Logistic regression -use layouts, multiple statistical measures in a single dataset using GraphPad PrismLogistic regressionMultiple ...
Read more >
Prisma migration is bad state - Stack Overflow
A possible workaround would involve baselining your development database based on your current schema/migration history.
Read more >
Prisma 4.8.0 Release - GitClear
You can further evolve your database schema using the multi-schema Preview feature by using prisma migrate dev . For further details, refer to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found