Giter VIP home page Giter VIP logo

Comments (9)

gpotet avatar gpotet commented on September 24, 2024

To close?

from safe-pg-migrations.

DrPlop avatar DrPlop commented on September 24, 2024

To close?

If you don't need this feature anymore, you can definitively close this old PR

from safe-pg-migrations.

ThHareau avatar ThHareau commented on September 24, 2024

I believe this issue is still a real problem; with a UUID as a primary key (or actually with any table whose primary key is not an integer named id), backfilling the default value would not work.

On the other hand, this method is only used with old versions of PG. Fixing the library is tricky here, a better solution would be to simply update the README, indicating that a numeric primary key named id is required for having the backfill work.

from safe-pg-migrations.

mikatuo avatar mikatuo commented on September 24, 2024

Is there a way to disable the backfill in batches logic? Most of our tables have uuid as primary keys which will make usage of this gem impossible :(

from safe-pg-migrations.

rchoquet avatar rchoquet commented on September 24, 2024

Hey @mikatuo, which version of PG are you using? If you are using PG11+ this logic is disabled as it's handled by PG itself.
If not, we should adapt the backfill logic to make it work with uuid primary keys.

from safe-pg-migrations.

mikatuo avatar mikatuo commented on September 24, 2024

9.6

from safe-pg-migrations.

pablosole avatar pablosole commented on September 24, 2024

Hi there, just found this issue and it affects me too. I'm using PSQL 10.12 so the new logic didn't kick in either.

from safe-pg-migrations.

ThHareau avatar ThHareau commented on September 24, 2024

A good solution for that would be to rely on BatchEnumerator or directly in_batches, in the method backfill_column_default

I am not planning to work on it soon, but I'd be happy to review a PR :)

from safe-pg-migrations.

ThHareau avatar ThHareau commented on September 24, 2024

Hey @mikatuo, @pablosole and maybe @DrPlop, I merged a PR which should solve the issue, can you tell me if it solves your issue?

I'm about to release a new version of the gem, but if you want to try it sooner you should rely on the last commit

from safe-pg-migrations.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.