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.

Run a migration by hand and update the migration table manually

See original GitHub issue

Problem

Adding indexes should be done concurrently in postgres

Prisma generates indexes in the migration.

Indexes concurrently can’t be added in a transaction

I run the migration manually by hand and comment out the add indexes while running prisma migrate deploy

Afterwards Prisma deploy will say

WARNING The following migrations have been modified since they were applied:

Suggested solution

One solution could be:

Output the checksum so that I can update it manually

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
aledalgrandecommented, May 16, 2022

Thanks for the update. That feature would really help with databases that have tables with millions of rows with a lot of traffic, as creating an index with locking is not feasible.

1reaction
janpiocommented, May 16, 2022

Everything that is not supported is on the roadmap - the question is when exactly. Right now CREATE INDEX CONCURRENTLY is not super high on that list as we have more basic functionality (see feature requests).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code First Migrations - EF6 - Microsoft Learn
Let's use Update-Database to apply this migration to the database. Run the Update-Database command in Package Manager Console; Code First ...
Read more >
How to Run a Django Migration “By Hand” - Adam Johnson
Normally your Django project's deploy process runs the migrate command, and that takes care of updating your database as necessary.
Read more >
Create a Migration in Rails Manually | by Shaqqour - Medium
Migration in Rails is responsible for creating and editing database tables. To migrate the database changes in rails, run $ rails db:migrate.
Read more >
Migrations
Rails 3.1 makes migrations smarter by providing a new change method. This method is preferred for writing constructive migrations (adding columns or tables)....
Read more >
how to re-migrate a laravel migration after deleting the table
Laravel keeps a record of migrations that have been run. You need to go to the migrations table and delete the migration record....
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