
160 - PostgreSQL with Andrew Atkinson
Code with Jason
00:00
Rails Migration
There is a rails migration option called validate check constraint, which is what you would want to use in that situation. You can supply the table name and then the name of the constraint, and that will run another statement against your data base. And it does it a acquires a less disruptive lock. So it's not just about deferring the operation to off peak. It also does acquire a less a disruptiv lock for other live transactions,. The validation constraint verses adding the constraint. Does that make sense? I believe that makes sense.
Transcript
Play full episode