mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-05-05 06:04:44 +00:00
run postgres query for rows that changes is null for them and there is value for changes_text
This commit is contained in:
parent
d412b2b16a
commit
bec21f98ec
1 changed files with 7 additions and 1 deletions
|
|
@ -125,7 +125,13 @@ class Command(BaseCommand):
|
|||
def postgres():
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute(
|
||||
'UPDATE auditlog_logentry SET changes="changes_text"::jsonb'
|
||||
"""
|
||||
UPDATE auditlog_logentry
|
||||
SET changes="changes_text"::jsonb
|
||||
WHERE changes_text IS NOT NULL
|
||||
AND changes_text <> ''
|
||||
AND changes IS NULL
|
||||
"""
|
||||
)
|
||||
return cursor.cursor.rowcount
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue