HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/trac/upgrades/__pycache__/db44.cpython-310.pyc
o

�k�`��@spddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
dZd	d
�ZdZdd
�ZdS)�N)�DatabaseManager)�Column�Table)�ResourceNotFound)�Report)�printout)�_zEhttps://trac.edgewall.org/wiki/1.3/TracUpgrade#enum-description-fieldc
Cs�tddd�td�td�td�td�fg}|j�=t|��|�g}dD])}zt||�}Wn	ty6Yq$wt|j�}|rF||_|�	�q$|�
t|��q$Wd	�n1sXwY|rod
�|�}t
td|td��d	Sd	S)
z)Add `description` column to `enum` table.�enum)�type�name)�keyr
r�value�description)�������Nz, z�Report(s) %(ids)s could not be upgraded and may need to be manually
edited to avoid an "ambiguous column name" error. See %(url)s for more
information.
)�ids�url)rr�db_transactionr�upgrade_tablesrr�replace_sql_fragment�query�update�append�str�joinrrr)�env�version�cursor�
new_schema�failures�id_�rr�r'�4/usr/lib/python3/dist-packages/trac/upgrades/db44.py�
do_upgrades<
���	�

��
��r)z.(?<!\.)(description AS _description)((?=_)|\b)cCs&tt�t|��dkrt�td|�SdS)z�Replace SQL fragment, but try to confirm that the default reports
    haven't been modified. The default reports have at most one
    'description AS ...' fragment.
    rzt.\1N)�len�re�findall�pattern�sub)rr'r'r(r@s�r)r+�trac.db.apir�trac.db.schemarr�
trac.resourcer�trac.ticket.modelr�trac.util.textr�trac.util.translationrrr)r-rr'r'r'r(�<module>s
%