title: Rails Postgres migration without downtime
body: <p>Let's say I want to add a column on my <code>users</code> table running the following migration</p>
  
  <pre><code>class AddVersionHistoryToUsers &lt; ActiveRecord::Migration
    def change
      add_column :users, :versions, :string, array: true, default: '{}'
      User.find_each do |user|
        if user.app_version?
          user.versions &lt;&lt; user.app_version.to_s
          user.save!
        end
      end
    end
  end
  </code></pre>
  
  <p>My aim is to insert the current <code>app_version</code> of each user into the <code>versions</code> array. How can I execute a migration without a lock in the users table due to the default value?</p>