관리-도구
편집 파일: sqlite_changelog.cpython-311.pyc
� M�Dg� � �R � d dl T d dlmZ G d� de� � Z G d� de� � ZdS )� )�*)� JSONFieldc � � e Zd Z e ed� � g�� � Z e� � Z e� � Z e � � Z e� � ZdS )� BaseChangeLogzDEFAULT CURRENT_TIMESTAMP)�constraintsN) �__name__� __module__�__qualname__� DateTimeField�SQL� timestamp� TextField�action�table�IntegerField�primary_keyr �changes� � �z/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/playhouse/sqlite_changelog.pyr r sZ � � � � � �� �3�3�/J�+K�+K�*L�M�M�M�I� �Y�[�[�F��I�K�K�E��,�.�.�K��i�k�k�G�G�Gr r c �^ � e Zd ZeZdZdZdZd d�Zdd�Z dd�Z d � Zed � � � Z dd�ZdS )� ChangeLoga� CREATE TRIGGER IF NOT EXISTS %(table)s_changes_%(action)s AFTER %(action)s ON %(table)s BEGIN INSERT INTO %(change_table)s ("action", "table", "primary_key", "changes") SELECT '%(action)s', '%(table)s', %(new_old)s."%(primary_key)s", "changes" FROM ( SELECT json_group_object( col, json_array( case when json_valid("oldval") then json("oldval") else "oldval" end, case when json_valid("newval") then json("newval") else "newval" end) ) AS "changes" FROM ( SELECT json_extract(value, '$[0]') as "col", json_extract(value, '$[1]') as "oldval", json_extract(value, '$[2]') as "newval" FROM json_each(json_array(%(column_array)s)) WHERE "oldval" IS NOT "newval" ) ); END;z3DROP TRIGGER IF EXISTS %(table)s_changes_%(action)s)�INSERT�UPDATE�DELETE� changelogc �"