PostgreSQL locks in Rails Migrations
When we need to update huge data by adding a rails Migrations or a rake/Thor task. We should worry about the PostgreSQL locks. Every time when we work with the production data for updating, there is always an risk of locking the database. By locking the database, I mean, the data do not get updated, or simply it would delay the process. So let's see the case of locking the PostgreSQL: So, In this example if we need to update the default value of available from nil to false, and let's say we have 1 million of data, this migration will only add the new values and won't affect the old values.