+
    Tj9                     L    ^ RI Ht ^ RIHt ^ RIHt ^ RIHt  ! R R]4      tR# )    )BaseDatabaseSchemaEditor)IndexColumns)sql)strip_quotesc                   .  a a ] tR t^t oRtRtRtRtRtRt	Rt
RtR	tR
tR/V 3R lltRtRtR tV 3R ltR tR tR tR tR tR tV 3R ltR0V 3R lltV 3R ltR0R ltR0R ltR1V 3R lltRRRRR R!R"R!R#RR$R.R%RR&R.R'RR(RR)RR*R/V 3R+ lltR, t R-t!Vt"V ;t## )2DatabaseSchemaEditorzeUPDATE %(table)s SET %(column)s = %(default)s WHERE %(column)s IS NULL; SET CONSTRAINTS ALL IMMEDIATEz1ALTER SEQUENCE IF EXISTS %(sequence)s AS %(type)sz,DROP SEQUENCE IF EXISTS %(sequence)s CASCADEzZCREATE INDEX %(name)s ON %(table)s%(using)s (%(columns)s)%(include)s%(extra)s%(condition)szgCREATE INDEX CONCURRENTLY %(name)s ON %(table)s%(using)s (%(columns)s)%(include)s%(extra)s%(condition)szDROP INDEX IF EXISTS %(name)sz*DROP INDEX CONCURRENTLY IF EXISTS %(name)szyCONSTRAINT %(name)s REFERENCES %(to_table)s(%(to_column)s)%(deferrable)s; SET CONSTRAINTS %(namespace)s%(name)s IMMEDIATEzRSET CONSTRAINTS %(name)s IMMEDIATE; ALTER TABLE %(table)s DROP CONSTRAINT %(name)sz,DROP FUNCTION %(procedure)s(%(param_types)s)c                   < Vf   \         SV `  W4      # V P                  P                  P	                  \        V4      V4      p\         SV `  VR 4      # N)superexecute
connectionopscompose_sqlstr)selfr   params	__class__s   &&&Y/var/www/idalgo/venv/lib/python3.14/site-packages/django/db/backends/postgresql/schema.pyr   DatabaseSchemaEditor.execute*   sH    >7?3//oo!!--c#h?wsD))    zRALTER TABLE %(table)s ALTER COLUMN %(column)s ADD GENERATED BY DEFAULT AS IDENTITYzEALTER TABLE %(table)s ALTER COLUMN %(column)s DROP IDENTITY IF EXISTSc                V    \         P                  ! WP                  P                  4      # r
   )r   quoter   )r   values   &&r   quote_value DatabaseSchemaEditor.quote_value:   s    yy : :;;r   c                r   < \         SV `  W4      pV P                  W4      pVe   VP                  V4       V# r
   )r   _field_indexes_sql_create_like_index_sqlappend)r   modelfieldoutputlike_index_statementr   s   &&&  r   r   'DatabaseSchemaEditor._field_indexes_sql=   s;    +E9#::5H+MM./r   c                    VP                   '       d   VP                  V P                  4      # V P                  P                  P	                  VP                  4       VP                  V P                  4      4      # r
   )is_relationrel_db_typer   
data_typesgetget_internal_typedb_typer   r!   s   &&r   _field_data_type%DatabaseSchemaEditor._field_data_typeD   s\    $$T__55))--##%MM$//*
 	
r   c              #     "   VP                   P                  4       R 8X  d&   V P                  VP                   4       Rj  xL
  R# V P                  VP                   4      x  R#  L%5i)
ArrayFieldN)
base_fieldr*   _field_base_data_typesr-   r,   s   &&r   r2   +DatabaseSchemaEditor._field_base_data_typesL   sS     --/<?2253C3CDDD''(8(899 Es   >A( A&&A(c                   VP                  V P                  R7      pVe   VP                  '       g   VP                  '       d   RV9   d   R# \	        VRR4      pV'       g*   VP
                  '       d   \	        VP                  RR4      pV'       d   V P                  V4      '       g   R# VP                  R4      '       d   V P                  VV.RR.R7      # VP                  R	4      '       d   V P                  VV.RR
.R7      # R# )z
Return the statement to create an index with varchar operator pattern
when the column type is 'varchar' or 'text', otherwise return None.
r   N[db_collationvarchar_likevarchar_pattern_ops)fieldssuffix	opclassestexttext_pattern_ops)
r+   r   db_indexuniquegetattrr&   target_field_is_collation_deterministic
startswith_create_index_sql)r   r    r!   r+   collation_names   &&&  r   r   +DatabaseSchemaEditor._create_like_index_sqlS   s    
 --4??-;ENNNelll g~ %UNDAN!e&7&7&7!(););^T!Rd&F&F~&V&V!!),,--!7"45	 .   ##F++--!7"12	 .   r   c                R   VP                   '       d   R # RpVP                  4       pVP                  4       pVR8X  dC   WE8X  d=   \        V P                  V4      4      \        V P                  V4      4      8w  d   V#  R # V P	                  V4      V P	                  V4      8w  d   V# R # ) z USING %(column)s::%(type)sr0   )	generatedr*   listr2   r-   )r   	new_field	old_field	using_sqlnew_internal_typeold_internal_types   &&&   r   
_using_sqlDatabaseSchemaEditor._using_sqlz   s    1	%779%779,1B1WD//	:;t++I6@  !   ""9-1F1Fy1QQr   c                "   V P                   P                  4       ;_uu_ 4       pV P                   P                  P                  W14       F&  pVR ,          V8X  g   K  VR,          u uuRRR4       # 	  RRR4       R#   + '       g   i     R# ; i)columnnameN)r   cursorintrospectionget_sequences)r   tablerU   rW   sequences   &&&  r   _get_sequence_name'DatabaseSchemaEditor._get_sequence_name   sl    __##%% OO99GGVH%/#F++ &%V & 	 &% s   4A=
A=1A==B	c                   VP                   ;'       g    VP                  ;'       d    VP                  R 4      ;'       d    VP                  R 4      '       * ;'       gg    VP                  R4      ;'       d    VP                  R4      '       * ;'       g0    VP                  R4      ;'       d    VP                  R4      '       * # )r8   r>   citext)r@   rA   rE   )r   rN   old_typenew_types   &&&&r   (_is_changing_type_of_indexed_text_column=DatabaseSchemaEditor._is_changing_type_of_indexed_text_column   s    ""66i&6&6 
 
  +RRH4G4G	4R0R U U##F+OOH4G4G4O0OU U##H-SSh6I6I(6S2S	
r   c                8  < VP                  V P                  R 7      pVR,          pV P                  W(V4      '       dT   V P                  VP                  P
                  VP                  .RR7      p	V P                  V P                  W4      4       RV n	        V P                  W24      ;p
'       d   V ;P                  V
,          un	        VP                  4       pVP                  4       p\        VP                  P
                  4      p0 RmpW9   pW9   pV'       d   V'       gx   \        VP                  4      pV P                  RV P                  V4      RVR	R
/,          . 3V P                  RV P                  V4      RV P                  V4      /,          . 3.3# V'       d   V'       g   V P                  V P                  RV P                  V4      RV P                  \        VP                  4      4      /,          4       \        VP                  4      p\         SV `E  WW4WV4      w  pp. pV P%                  VV4      ;p'       d(   V P&                  RV P                  V4      /,          . 3.pVV3# V'       d   V'       d   W8w  d   \         SV `E  WW4WV4      w  pp\        VP                  4      pRRRRRR/p. pV P%                  VV4      ;p'       d1   V P(                  RV P                  V4      RVV,          /,          . 3.pVV3# \         SV `E  WW4WV4      # )r5   typer9   r<   z2ALTER COLUMN %(column)s TYPE %(type)s%(collation)s	AutoFieldBigAutoFieldSmallAutoFieldrU   	collationrJ   rZ   r[   integerbigintsmallint>   rg   rh   ri   )db_parametersr   rb   _create_index_name_metadb_tablerU   r   _delete_index_sqlsql_alter_column_typerR   r*   r   
quote_namesql_add_identitysql_drop_indentityr   _alter_column_type_sqlr\   sql_delete_sequencesql_alter_sequence_type)r   r    rN   rM   ra   old_collationnew_collationold_db_paramsr`   
index_namerO   rP   rQ   rZ   auto_field_typesold_is_autonew_is_autorU   fragment_other_actionssequence_namedb_typesr   s   &&&&&&&                r   rw   +DatabaseSchemaEditor._alter_column_type_sql   sD   
 "//4??/K (88hWW00$$y'7'7&8 1 J LL//BC A 	" 	==9=&&)3&%779%779U[[112

 (;';{!)"2"23F .. $//&"9#R  --#T__U%;$doof&=
 	 *  LL''T__U3dool9;K;K.LM ")"2"23F'8)}KHa
 M $ 7 7v FF}F 00&(F ! ]**[->-S'8)}KHa ")"2"23FY *H M $ 7 7v FF}F 44&(F"H->$?
 	! ]**71)} r   Fc	           
       < \         SV `  VVVVVVVV4       VP                  '       g%   VP                  '       g   VP                  '       g=   VP                  '       g   VP                  '       g   V P	                  W$V4      '       d'   V P                  W4      p	V	e   V P                  V	4       VP                  '       d~   VP                  '       gj   VP                  '       gV   V P                  VP                  P                  VP                  .RR7      p
V P                  V P                  W4      4       R # R # R # R # )Nr9   rf   )r   _alter_fieldr@   rA   rb   r   r   ro   rp   rq   rU   rr   )r   r    rN   rM   r`   ra   r|   new_db_paramsstrictr#   index_to_remover   s   &&&&&&&&&  r   r   !DatabaseSchemaEditor._alter_field  s    			
 $$$	(8(8(8i>P>P>P$$$)9)9)9== 
 $(#>#>u#P #/12 Y%7%7%79;K;K;K"55$$y'7'7&8 6 O LL//GH	 <L%7r   c                h   < V'       d   \        VVV P                  VVR 7      # \        SV `  WW44      # ))col_suffixesr=   )r   rt   r   _index_columns)r   rZ   columnsr   r=   r   s   &&&&&r   r   #DatabaseSchemaEditor._index_columns1  s:    )#  w%elNNr   c                N    V P                  VP                  WVR 7      RR7       R# )concurrentlyN)r   )r   
create_sqlr   r    indexr   s   &&&&r   	add_indexDatabaseSchemaEditor.add_index<  s(    U|DT 	 	
r   c                J    V P                  VP                  WVR 7      4       R# )r   N)r   
remove_sqlr   s   &&&&r   remove_index!DatabaseSchemaEditor.remove_indexA  s    U%%e%MNr   Nc                x   < T;'       g!    V'       d   V P                   MV P                  p\        SV `  WV4      # r
   )sql_delete_index_concurrentlysql_delete_indexr   rr   )r   r    rV   r   r   r   s   &&&&&r   rr   &DatabaseSchemaEditor._delete_index_sqlD  s@     
 
 ..&& 	
 w(c::r   r;   rV   r<   rJ   usingdb_tablespacer   r   r=   	conditionr   includeexpressionsc                  < T;'       g!    V'       g   V P                   MV P                  p\        SV `  VVVVVVVVV	V
VVR 7      # ))r;   rV   r<   r   r   r   r   r=   r   r   r   )sql_create_indexsql_create_index_concurrentlyr   rF   )r   r    r;   rV   r<   r   r   r   r   r=   r   r   r   r   r   s   &&$$$$$$$$$$$$r   rF   &DatabaseSchemaEditor._create_index_sqlL  sk    "  
 
 !!33 	
 w('%# ) 
 	
r   c                    V P                   P                  4       ;_uu_ 4       pVP                  R V.4       VP                  4       pV'       d
   V^ ,          MRuuRRR4       #   + '       g   i     R# ; i)z
                SELECT collisdeterministic
                FROM pg_collation
                WHERE collname = %s
                N)r   rW   r   fetchone)r   rG   rW   rows   &&  r   rD   0DatabaseSchemaEditor._is_collation_deterministicq  sX    __##%%NN
    //#C 3q6d &%%%s   6A$$A5	)rs    )r   )F)NF)$__name__
__module____qualname____firstlineno__sql_update_with_defaultry   rx   r   r   r   r   sql_create_column_inline_fksql_delete_fksql_delete_procedurer   ru   rv   r   r   r-   r2   r   rR   r\   rb   rw   r   r   r   r   rr   rF   rD   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      sL    	*  RH	9 
	9 " 7$P!
	<  	9  J*	+ 
 	P <
:%N 
m^(IT	O

O;#
 	#

 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
 #
J+ +r   r   N)	django.db.backends.base.schemar   !django.db.backends.ddl_referencesr   )django.db.backends.postgresql.psycopg_anyr   django.db.backends.utilsr   r   r   r   r   <module>r      s     C : 9 1u+3 u+r   