Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/operations/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/operations/__pycache__/schemaobj.cpython-311.pyc

�

�܋f�$��t�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZ
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZe	rBddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddl"m#Z#ddl$m%Z%Gd�d��Z&d S)!�)�annotations)�Any)�Dict)�List)�Optional)�Sequence)�Tuple)�
TYPE_CHECKING)�Union��schema)�Column)�
Constraint)�Index)�Integer)�NULLTYPE�)�util)�sqla_compat)�
ColumnElement)�
TextClause)�CheckConstraint)�
ForeignKey)�ForeignKeyConstraint)�MetaData)�PrimaryKeyConstraint)�Table)�UniqueConstraint)�
TypeEngine)�MigrationContextc��eZdZ	d<d=d�Z	d<d>d�Z							d?d@d�Z	d<dAd!�Z	d<dBd%�Z	d<dCd(�ZdDd*�Z	dEd,�Z
dFd/�Z	d<dGd4�ZdHd7�Z
dId;�ZdS)J�
SchemaObjectsN�migration_context�Optional[MigrationContext]�return�Nonec��||_dS�N)r#)�selfr#s  �S/opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/operations/schemaobj.py�__init__zSchemaObjects.__init__&s��"3������name�,Optional[sqla_compat._ConstraintNameDefined]�
table_name�str�cols�
Sequence[str]r
�
Optional[str]rc��	�|���}d�|D��}tj||g|�Rd|i��	tj�	fd�|D��d|i|��}|S)Nc�B�g|]}tj|t����S���	sa_schemarr��.0�ns  r*�
<listcomp>z8SchemaObjects.primary_key_constraint.<locals>.<listcomp>4s%��?�?�?�Q�9�#�A�x�0�0�?�?�?r,r
c�*��g|]}�j|��Sr6��c�r:r;�ts  �r*r<z8SchemaObjects.primary_key_constraint.<locals>.<listcomp>9s���
#�
#�
#��a�c�!�f�
#�
#�
#r,r-)�metadatar8rr)
r)r-r/r1r
�
dialect_kw�m�columns�prAs
         @r*�primary_key_constraintz$SchemaObjects.primary_key_constraint+s����
�M�M�O�O��?�?�$�?�?�?���O�J��C�G�C�C�C�F�C�C��
�*�
#�
#�
#�
#�d�
#�
#�
#�
�*.�
�2<�
�
���r,�source�referent�
local_cols�	List[str]�remote_cols�onupdate�ondelete�
deferrable�Optional[bool]�
source_schema�referent_schema�	initially�matchrc
	���|���}||kr|	|
kr||z}n"|}tj||gd�|D���Rd|
i�tj||gd�tj|��D���Rd|	i�}|
r|
�d|��n|�||
d<tj|�fd�|D��f|||||d�|
��}|�|��|S)Nc�B�g|]}tj|t����Sr6r7r9s  r*r<z8SchemaObjects.foreign_key_constraint.<locals>.<listcomp>Us%��E�E�E�A�)�"�1�h�/�/�E�E�Er,r
c�B�g|]}tj|t����Sr6r7r9s  r*r<z8SchemaObjects.foreign_key_constraint.<locals>.<listcomp>\s5������� ��H�-�-���r,�.rTc���g|]	}��d|����
S)rXr6)r:r;�tnames  �r*r<z8SchemaObjects.foreign_key_constraint.<locals>.<listcomp>ms$���7�7�7�a����q�q�
!�7�7�7r,)r-rMrNrOrS)rBr8rr�unique_listr�append_constraint)r)r-rHrIrJrLrMrNrOrQrRrSrTrCrD�t1_cols�t1�frZs                  @r*�foreign_key_constraintz$SchemaObjects.foreign_key_constraint=sr��� 
�M�M�O�O���X���-�?�"B�"B� �;�.�G�G� �G��O���
�F�E��E�E�E�
�
�
�'�	
�
�
��_��
�
����)�'�2�2����
�
�
�!�
�
���
������1�1��	�$�
�7���*��7�7�7�7�;�7�7�7�	
����!��	
�	
��	
�	
��	���Q�����r,rc����tj||���gd�|D���Rd|i��||d<tj�fd�|D��i|��}��|��|S)Nc�B�g|]}tj|t����Sr6r7r9s  r*r<z3SchemaObjects.unique_constraint.<locals>.<listcomp>�s%��
@�
@�
@��i��q�(�+�+�
@�
@�
@r,r
r-c�*��g|]}�j|��Sr6r>r@s  �r*r<z3SchemaObjects.unique_constraint.<locals>.<listcomp>�s���)E�)E�)E�Q�!�#�a�&�)E�)E�)Er,)r8rrBrr\)r)r-rHrJr
�kw�uqrAs       @r*�unique_constraintzSchemaObjects.unique_constraintys����
�O���M�M�O�O�
�A�
@�Z�
@�
@�
@�
�
�
��	
�
����6�
�
�
'�)E�)E�)E�)E�*�)E�)E�)E�
L��
L�
L��	
���B�����	r,�	condition�*Union[str, TextClause, ColumnElement[Any]]�Union[CheckConstraint]c���tj||���tjdt��|���}tj|fd|i|��}|�|��|S)N�xrr-)r8rrBrrrr\)r)r-rHrgr
rdrA�cks        r*�check_constraintzSchemaObjects.check_constraint�ss��
�O���M�M�O�O���S�'�*�*��	
�
�
���
&�y�
B�
B�t�
B�r�
B�
B��	���B�����	r,�type_rc
�v�|�||���}d�tjtjd�tjd�}	||}||���}|�|��|S#t$rB}	tdd�td�|D������z��|	�d}	~	wwxYw)	Nrc�0�tjgg|���S)N�r-)r8rrqs r*�<lambda>z2SchemaObjects.generic_constraint.<locals>.<lambda>�s��y�'E��B�T�(�(�(�r,c�.�tjd|���S)N�rq)r8rrqs r*rrz2SchemaObjects.generic_constraint.<locals>.<lambda>�s��)�";�B�T�"J�"J�"J�r,)�
foreignkey�primary�unique�checkNrqz'type' can be one of %sz, c3�4K�|]}t|��V��dSr()�repr)r:rks  r*�	<genexpr>z3SchemaObjects.generic_constraint.<locals>.<genexpr>�s(����":�":�q�4��7�7�":�":�":�":�":�":r,)
�tabler8rrrr\�KeyError�	TypeError�join�sorted)
r)r-r/rnr
rdrA�types�const�kes
          r*�generic_constraintz SchemaObjects.generic_constraint�s���
�J�J�z�&�J�1�1����!�5��0�J�J��&�+
�+
��
	��%�L�E��E�t�$�$�$�E�
����&�&�&��L���	�	�	��)��)�)�F�":�":�E�":�":�":�:�:�;�;�<����
�����	���s�A,�,
B8�6=B3�3B8rc��i}|j�:d|jjvr,|jjd}t|d��r
|j|d<t	jdi|��S)N�target_metadata�naming_conventionr6)r#�opts�hasattrr�r8r)r)rd�mts   r*rBzSchemaObjects.metadata�sj��
���"�.�!�T�%;�%@�@�@��'�,�->�?�B��r�.�/�/�
?�*,�*>��&�'��!�'�'�B�'�'�'r,rc�Z��|���}d�|D��}|�dd��}|r|D]}dx|_|_�t	j||g|�Ri|����fd�|D��}|D]}	��|	����jD]}
|�||
����S)Nc�r�g|]4}t|t���|j�tj|��n|��5Sr()�
isinstancerr|r�_copy)r:r?s  r*r<z'SchemaObjects.table.<locals>.<listcomp>�sO��
�
�
���!�V�$�$�
�$%�G�$7�K��a� � � �Q�
�
�
r,�_constraints_includedFc���g|]Z}t|ttf���t|dd���ur't|dd���t	j|����n|��[S)�parentN)�target_table)r�rr�getattrrr�)r:�elemrAs  �r*r<z'SchemaObjects.table.<locals>.<listcomp>�s����
�
�
�
��$��U� 3�4�4�

��t�X�t�,�,�A�5�5���h��-�-�9�
��d��3�3�3�3��	
�
�
r,)	rB�poprw�indexr8rr\�foreign_keys�_ensure_table_for_fk)r)r-rErdrDr1r�r?�constraintsr�r_rAs           @r*r|zSchemaObjects.table�s����M�M�O�O��
�
��
�
�
��!#���'>�� F� F�� �	+��
+�
+��%*�*���1�7�7��O�D�!�1�d�1�1�1�b�1�1��
�
�
�
�
 �
�
�
��!�	'�	'�E�
����&�&�&�&���	,�	,�A��%�%�a��+�+�+�+��r,rrc�(�tj||fi|��Sr()r8r)r)r-rnrds    r*�columnzSchemaObjects.column�s�����e�2�2�r�2�2�2r,�	tablenamerE�4Sequence[Union[str, TextClause, ColumnElement[Any]]]rc���tj|pd|���|�����|d<tj|g�fd�|D���Ri|��}|S)N�no_tabler�_tablec�P��g|]"}tj��|����#Sr6)rr�_textual_index_columnr@s  �r*r<z'SchemaObjects.index.<locals>.<listcomp>s,���
L�
L�
L�q�d��4�4�Q��:�:�
L�
L�
Lr,)r8rrBr)r)r-r�rEr
rd�idxrAs       @r*r�zSchemaObjects.index�s����
�O��#���M�M�O�O��
�
�
��
��8���o��
�
L�
L�
L�
L�G�
L�
L�
L�
�
�
��
�
��
�
r,�	table_key�Tuple[Optional[str], str]c��d|vr;|�d��}d�|dd���}|d}n|}d}||fS)NrXr���)�splitr)r)r��tokens�snamerZs     r*�_parse_table_keyzSchemaObjects._parse_table_keysV���)����_�_�S�)�)�F�#&�8�8�F�1�R�4�L�#9�#9�E��2�J�E�E��E��E��u�~�r,rB�fkrc�v�t|jt��r�|j�dd��\}}|�|��\}}||jvrt
j|||���}n
|j|}||jvr1|�	t
j
|t����dSdSdS)zUcreate a placeholder Table object for the referent of a
        ForeignKey.

        rX�rN)r��_colspecr0�rsplitr��tablesr8rr?�
append_columnrr)r)rBr�r��cnamer�rZ�rel_ts        r*r�z"SchemaObjects._ensure_table_for_fks���
�b�k�3�'�'�
	G�!�{�1�1��Q� � ��I�u� �0�0��;�;�L�E�5����/�/�!���x��F�F�F��� ��	�2���E�G�#�#��#�#�I�$4�U�H�$E�$E�F�F�F�F�F�
	G�
	G�$�#r,r()r#r$r%r&)
r-r.r/r0r1r2r
r3r%r)NNNNNNN)r-r.rHr0rIr0rJrKrLrKrMr3rNr3rOrPrQr3rRr3rSr3rTr3r%r)
r-r.rHr0rJr2r
r3r%r)
r-r.rHr0rgrhr
r3r%ri)
r-r.r/r0rnr3r
r3r%r)r%r)r-r0r%r)r-r0rnrr%r)
r-r3r�r3rEr�r
r3r%r)r�r0r%r�)rBrr�rr%r&)�__name__�
__module__�__qualname__r+rGr`rfrmr�rBr|r�r�r�r�r6r,r*r"r"%sb������>B�3�3�3�3�3�!%������2#'�"&�%)�'+�)-�#'�#�:�:�:�:�:�B!%������4!%������.!%������<	(�	(�	(�	(�#�#�#�#�J3�3�3�3�!%������*����G�G�G�G�G�Gr,r"N)'�
__future__r�typingrrrrrr	r
r�
sqlalchemyr
r8�sqlalchemy.sql.schemarrr�sqlalchemy.typesrrrtrr�sqlalchemy.sql.elementsrrrrrrrrr�sqlalchemy.sql.type_apir�runtime.migrationr r"r6r,r*�<module>r�sK��"�"�"�"�"�"������������������������������������� � � � � � �������*�*�*�*�*�*�(�(�(�(�(�(�,�,�,�,�,�,�'�'�'�'�'�'�$�$�$�$�$�$�%�%�%�%�%�%��������������5�5�5�5�5�5�5�2�2�2�2�2�2�5�5�5�5�5�5�0�0�0�0�0�0�:�:�:�:�:�:�.�.�.�.�.�.�:�:�:�:�:�:�+�+�+�+�+�+�6�6�6�6�6�6�2�2�2�2�2�2�4�4�4�4�4�4�zG�zG�zG�zG�zG�zG�zG�zG�zG�zGr,

Hacked By AnonymousFox1.0, Coded By AnonymousFox