Commit Graph

8 Commits (f8e09ac4a8f136a0ba96d233db5ff6f77967271a)

Author SHA1 Message Date
ThibG 80b5a5d735 Fix old migration script depending on the StreamEntry model (#11278) 2019-07-10 17:09:10 +02:00
ThibG d329c3ab5e Fix FixAccountsUniqueIndex migration (#8212) 2018-08-15 20:23:12 +02:00
ThibG c74125df6a Make some migration script more robust (fixes #8007) (#8170)
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.
2018-08-11 18:00:41 +02:00
Eugen Rochko 5d2d05961c Wrong exception class: ActiveRecord::RecordNotUnique, not PG::UniqueViolation (#7688)
* 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
2018-05-31 17:22:33 +02:00
Eugen Rochko 7c50de2219 Improve account index migration (#7684)
* 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
2018-05-31 17:09:09 +02:00
Eugen Rochko 40ed681914 Fix nil error in migration (#7680)
Under rare circumstances the user record could have already been deleted before...
2018-05-31 02:30:37 +02:00
Yamagishi Kazutoshi abda29af50 Fix broken migrate (regression from #7658) (#7674) 2018-05-30 09:39:52 +02:00
Eugen Rochko 2ba4e0bf1a Deduplicate accounts and make unique username/domain index case-insensitive (#7658)
Fix #6937
Fix #6837
Fix #6667
2018-05-30 02:51:26 +02:00