Created
April 2, 2020 18:05
-
-
Save victorusachev/087c739d9372f32028af61325cc19a9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| mcl.changes #>> '{name, old_value, repr}' | |
| FROM history_modelchangelog as mcl | |
| WHERE ( | |
| mcl.action = 'updated' | |
| AND (mcl.changes #>> '{name, new_value, repr}') = %(new_name)s | |
| AND (mcl.changes #>> '{name, old_value, repr}') IS NOT NULL | |
| AND mcl.content_type_id = %(content_type_id)s | |
| AND mcl.object_id = %(object_id)s | |
| ) | |
| ORDER BY mcl.updated_at DESC | |
| LIMIT 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment