Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
* Wrong exception class: ActiveRecord::RecordNotUnique, not PG::UniqueViolation
It's completely not obvious but PG::UniqueViolation is just a string inside the exception message, not the actual class of the exception
* Favourite does not have target_account_id
* Improve account index migration
- Display more progress in stdout
- Catch PG::UniqueViolation when re-attributing favourites
- Skip callbacks and validations when re-attributing other relationships
* Use in_batches to reduce table lock-up during account merge
* Use #say_with_time to benchmark each deduplication