https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/postgres/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/postgres/__pycache__/operations.cpython-310.pyc
o

3�a$�@s6ddlmZmZmZddlmZmZddlmZm	Z	ddl
mZGdd�de�ZGdd�de�Z
Gd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�dee�ZGdd�dee	�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#S)$�)�get_citext_oids�get_hstore_oids�register_type_handlers)�NotSupportedError�router)�AddIndex�RemoveIndex)�	Operationc@sLeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
dd��ZdS)�CreateExtensionTcCs
||_dS�N��name)�selfr
�r�D/usr/lib/python3/dist-packages/django/contrib/postgres/operations.py�__init__�
zCreateExtension.__init__cC�dSrr�r�	app_label�staterrr�state_forwards�zCreateExtension.state_forwardscCsb|jjdkst�|jj|�sdS|�||j�s"|�d|�|j��t	�
�t�
�t|j�dS)N�
postgresqlz!CREATE EXTENSION IF NOT EXISTS %s)
�
connection�vendorr�
allow_migrate�alias�extension_existsr
�execute�
quote_namer�cache_clearrr�rr�
schema_editor�
from_state�to_staterrr�database_forwardss��z!CreateExtension.database_forwardscCsLt�|jj|�s
dS|�||j�r|�d|�|j��t�	�t
�	�dS)NzDROP EXTENSION IF EXISTS %s)rrrrrr
rr rr!rr"rrr�database_backwards$s�z"CreateExtension.database_backwardscCsH|j���}|�d|g�t|���Wd�S1swYdS)Nz-SELECT 1 FROM pg_extension WHERE extname = %s)r�cursorr�bool�fetchone)rr#�	extensionr(rrrr/s�
$�z CreateExtension.extension_existscC�
d|jS)NzCreates extension %sr�rrrr�describe7rzCreateExtension.describecCr,)Nzcreate_extension_%srr-rrr�migration_name_fragment:s
z'CreateExtension.migration_name_fragmentN)�__name__�
__module__�__qualname__�
reversiblerrr&r'rr.�propertyr/rrrrr
	sr
c@�eZdZdd�ZdS)�BloomExtensioncC�
d|_dS)N�bloomrr-rrrrArzBloomExtension.__init__N�r0r1r2rrrrrr6?�r6c@r5)�BtreeGinExtensioncCr7)N�	btree_ginrr-rrrrGrzBtreeGinExtension.__init__Nr9rrrrr;Er:r;c@r5)�BtreeGistExtensioncCr7)N�
btree_gistrr-rrrrMrzBtreeGistExtension.__init__Nr9rrrrr=Kr:r=c@r5)�CITextExtensioncCr7)N�citextrr-rrrrSrzCITextExtension.__init__Nr9rrrrr?Qr:r?c@r5)�CryptoExtensioncCr7)N�pgcryptorr-rrrrYrzCryptoExtension.__init__Nr9rrrrrAWr:rAc@r5)�HStoreExtensioncCr7)N�hstorerr-rrrr_rzHStoreExtension.__init__Nr9rrrrrC]r:rCc@r5)�TrigramExtensioncCr7)N�pg_trgmrr-rrrrerzTrigramExtension.__init__Nr9rrrrrEcr:rEc@r5)�UnaccentExtensioncCr7)N�unaccentrr-rrrrkrzUnaccentExtension.__init__Nr9rrrrrGir:rGc@r5)�NotInTransactionMixincCs|jjrtd|jj��dS)Nz_The %s operation cannot be executed inside a transaction (set atomic = False on the migration).)r�in_atomic_blockr�	__class__r0�rr#rrr�_ensure_not_in_transactionps���z0NotInTransactionMixin._ensure_not_in_transactionN)r0r1r2rMrrrrrIosrIc@�,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�AddIndexConcurrentlyzDCreate an index using PostgreSQL's CREATE INDEX CONCURRENTLY syntax.FcCsd|jjd�|jj�|jfS)Nz7Concurrently create index %s on field(s) %s of model %s�, )�indexr
�join�fields�
model_namer-rrrr.}s
�zAddIndexConcurrently.describecCsD|�|�|j�||j�}|�|jj|�r |j||jdd�dSdS�NT)�concurrently)	rM�apps�	get_modelrT�allow_migrate_modelrr�	add_indexrQ�rrr#r$r%�modelrrrr&��

�z&AddIndexConcurrently.database_forwardscCsD|�|�|j�||j�}|�|jj|�r |j||jdd�dSdSrU)	rMrWrXrTrYrr�remove_indexrQr[rrrr'�r]z'AddIndexConcurrently.database_backwardsN�r0r1r2�__doc__�atomicr.r&r'rrrrrOysrOc@rN)
�RemoveIndexConcurrentlyzBRemove an index using PostgreSQL's DROP INDEX CONCURRENTLY syntax.FcCsd|j|jfS)Nz$Concurrently remove index %s from %s)r
rTr-rrrr.�sz RemoveIndexConcurrently.describecCs^|�|�|j�||j�}|�|jj|�r-|j||jf}|�	|j
�}|j||dd�dSdSrU)rMrWrXrTrYrr�models�model_name_lower�get_index_by_namer
r^)rrr#r$r%r\�from_model_staterQrrrr&��
�z)RemoveIndexConcurrently.database_forwardscCs^|�|�|j�||j�}|�|jj|�r-|j||jf}|�	|j
�}|j||dd�dSdSrU)rMrWrXrTrYrrrcrdrer
rZ)rrr#r$r%r\�to_model_staterQrrrr'�rgz*RemoveIndexConcurrently.database_backwardsNr_rrrrrb�srbc@s<eZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�CollationOperation�libcT)�provider�
deterministiccCs||_||_||_||_dSr)r
�localerkrl)rr
rmrkrlrrrr�s
zCollationOperation.__init__cCrrrrrrrr�rz!CollationOperation.state_forwardscCsJ|j|jd�}|jr|jdkr|j|d<|jdur|j|d<|jjg|fS)N)r
rmrjrkFrl)r
rmrkrlrKr2)r�kwargsrrr�deconstruct�s


�zCollationOperation.deconstructc	Cs�|jdur|jjjstd��|jdkr|jjjstd��d|�|j�i}|jdkr1|�|j�|d<|jdur:d|d<|�	d	|�|j
�d
�dd�|��D��d
��dS)NFz4Non-deterministic collations require PostgreSQL 12+.rjz*Non-libc providers require PostgreSQL 10+.rmrk�falserlz$CREATE COLLATION %(name)s (%(args)s)rPcss"�|]\}}|�d|��VqdS)�=Nr)�.0�option�valuerrr�	<genexpr>�s� z6CollationOperation.create_collation.<locals>.<genexpr>)r
�args)
rlr�features�%supports_non_deterministic_collationsrrk�&supports_alternate_collation_providersr rmrr
rR�items)rr#rvrrr�create_collation�s&
��
�


�z#CollationOperation.create_collationcCs|�d|�|j��dS)NzDROP COLLATION %s)rr r
rLrrr�remove_collation�s�z#CollationOperation.remove_collationN)r0r1r2rrror{r|rrrrri�sric@�4eZdZdZdd�Zdd�Zdd�Zedd	��Zd
S)�CreateCollationzCreate a collation.cC�.|jjdkst�|jj|�sdS|�|�dS�Nr)rrrrrr{r"rrrr&��
�z!CreateCollation.database_forwardscC�"t�|jj|�s
dS|�|�dSr)rrrrr|r"rrrr'��z"CreateCollation.database_backwardscC�d|j��S)NzCreate collation rr-rrrr.��zCreateCollation.describecC�d|j��S)Nzcreate_collation_%s�r
�lowerr-rrrr/��z'CreateCollation.migration_name_fragmentN�	r0r1r2r`r&r'r.r4r/rrrrr~��r~c@r})�RemoveCollationzRemove a collation.cCrr�)rrrrrr|r"rrrr&�r�z!RemoveCollation.database_forwardscCr�r)rrrrr{r"rrrr'�r�z"RemoveCollation.database_backwardscCr�)NzRemove collation rr-rrrr.r�zRemoveCollation.describecCr�)Nzremove_collation_%sr�r-rrrr/r�z'RemoveCollation.migration_name_fragmentNr�rrrrr��r�r�N)�django.contrib.postgres.signalsrrr�	django.dbrr�django.db.migrationsrr�$django.db.migrations.operations.baser	r
r6r;r=r?rArCrErGrIrOrbrir~r�rrrr�<module>s&6
3

https://t.me/RX1948 - 2025