Commit Graph

11 Commits

Author SHA1 Message Date
Gerhard Schlager c3b6811651 PERF: Split loading of posts to speed up user renames 2018-07-24 11:57:04 +02:00
Sam 5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
Robin Ward 587a9c82f5 FIX: Use the username formatter when updating cooked usernames 2018-05-25 17:29:06 -04:00
Gerhard Schlager 95db5f0c8c FIX: Do not replace wrong avatars when renaming user 2018-05-22 13:41:51 +02:00
Gerhard Schlager 74c4af279a Improvements to user renaming
* don't update search index if post belongs to deleted topic
* log errors instead of crashing when updating post or revision fails
* update mentions even when the href attribute is missing
* run the background job with low priority
* replace username in all notifications
* update `action_code_who` used by small action posts
2018-05-15 21:05:51 +02:00
Gerhard Schlager 2e1b5bc8d3 FIX: Transaction in UserAnonymizer prevented avatar from updating 2018-05-15 20:47:58 +02:00
Gerhard Schlager c67c2dc638 FIX: Username update should ignore revisions without raw 2018-05-14 15:22:42 +02:00
Gerhard Schlager 8232aba743 FIX: Update search index after renaming user within posts 2018-05-14 13:20:30 +02:00
Gerhard Schlager 02cb84847c FIX: Update avatar in oneboxed posts when renaming user 2018-05-14 13:20:29 +02:00
Gerhard Schlager 2e67998319 Improvements for user renaming (#5810)
* FEATURE: Update avatars in posts and revisions when user gets renamed

* FIX: Replace username in deleted posts when user gets renamed

* FEATURE: Replace username in notifications when user gets renamed

FEATURE: Update mentions and quotes when user gets merged
2018-05-08 10:02:43 -04:00
Gerhard Schlager 3be3c50c7e FEATURE: Rename user in mentions and quotes
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2018-05-01 13:49:14 -04:00