Comments (9)
To close?
from safe-pg-migrations.
To close?
If you don't need this feature anymore, you can definitively close this old PR
from safe-pg-migrations.
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.
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.
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.
9.6
from safe-pg-migrations.
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.
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.
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)
- using change_column_null can make the migration fail
- `SET` and `disable_ddl_transaction!` HOT 1
- add_column, null: false should be executed in one statement
- Wrong number of arguments - Rails 6.1 HOT 2
- Can't rollback an add_index migration HOT 7
- strong-migrations warns about dangerous operation when adding foreign key
- blocking_activity_logger: can't convert String into an exact number HOT 9
- Safe rename table & column HOT 2
- Idea: only disable DDL transaction for transactions that use helpers HOT 3
- Adding a foreign key causes `ArgumentError: unknown keyword: :column` HOT 1
- Option to disable IdempotentStatements? HOT 2
- Error undefined method `table' for "index_name":String on v1.4.0 HOT 4
- question: Is there a way to disable logging for some migrations? HOT 4
- safe rename_column seems to be missing? HOT 13
- Escape hatch for unsafe migrations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safe-pg-migrations.