+
    Tj)                     \    ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIH	t	  ! R R]4      t
R# )    N)DatabaseError)BaseDatabaseSchemaEditor_related_non_m2m_objects)duration_iso_stringc                      a a ] tR t^t oRtRtRtRtRtRt	]	t
RtRtR	tR
 tV 3R ltV 3R ltRV 3R lltV 3R ltV 3R ltR tR tR tV 3R ltR tR tR tRV 3R lltRtVtV ;t# )DatabaseSchemaEditorz3ALTER TABLE %(table)s ADD %(column)s %(definition)sz'MODIFY %(column)s %(type)s%(collation)szMODIFY %(column)s NULLzMODIFY %(column)s NOT NULLz%MODIFY %(column)s DEFAULT %(default)szMODIFY %(column)s DEFAULT NULLzHCONSTRAINT %(name)s REFERENCES %(to_table)s(%(to_column)s)%(deferrable)sz(DROP TABLE %(table)s CASCADE CONSTRAINTSz9CREATE INDEX %(name)s ON %(table)s (%(columns)s)%(extra)sc                   \        V\        P                  \        P                  \        P                  34      '       d
   R V,          # \        V\        P                  4      '       d   R \        V4      ,          # \        V\        4      '       d   R VP                  RR4      ,          # \        V\        \        \        34      '       d   R VP                  4       ,          # \        V\        4      '       d   V'       d   R# R# \        V4      # )z'%s''z''10)
isinstancedatetimedatetime	timedeltar   strreplacebytes	bytearray
memoryviewhexboolselfvalues   &&U/var/www/idalgo/venv/lib/python3.14/site-packages/django/db/backends/oracle/schema.pyquote_value DatabaseSchemaEditor.quote_value   s    ehmmX]]H<M<MNOOE>!x1122/666s##EMM#t444y*=>>EIIK''t$$3(S(u:    c                   < V P                  VP                  P                  VP                  4      '       d1   V P	                  VP                  P                  VP                  4       \
        SV `  W4       R # N)_is_identity_column_metadb_tablecolumn_drop_identitysuperremove_field)r   modelfield	__class__s   &&&r   r(   !DatabaseSchemaEditor.remove_field*   sQ     ##EKK$8$8%,,GG 4 4ellCU*r   c                   < \         SV `  V4       V P                  R RV P                  P                  P                  VP                  P                  4      /,          4       R# )aK  
            DECLARE
                i INTEGER;
            BEGIN
                SELECT COUNT(1) INTO i FROM USER_SEQUENCES
                    WHERE SEQUENCE_NAME = '%(sq_name)s';
                IF i = 1 THEN
                    EXECUTE IMMEDIATE 'DROP SEQUENCE "%(sq_name)s"';
                END IF;
            END;
        /sq_nameN)r'   delete_modelexecute
connectionops_get_no_autofield_sequence_namer#   r$   )r   r)   r+   s   &&r   r/   !DatabaseSchemaEditor.delete_model1   sT    U#
 4??..NNKK((	
r   c                  <  \         SV `  WW44       R#   \         EdG   p\        T4      pR T9   g   RT9   d   T P	                  YT4        Rp?R# RT9   dI   T P                  TP                  P                  TP                  4       T P                  YY44        Rp?R# RT9   d>   TP                  '       d,   T P                  TRR7       T P	                  YT4        Rp?R# RT9   dv   TP                  '       dd   T P                  TRR7       T P                  YY44       TP                  '       d'   T P                  T P                  Y4      4        Rp?R#  Rp?R# h Rp?ii ; i)z	ORA-22858z	ORA-22859z	ORA-30675z	ORA-30673T)strictz	ORA-43923N)r'   alter_fieldr   r   _alter_field_type_workaroundr&   r#   r$   r%   primary_key_delete_primary_keyr0   _create_primary_key_sql)r   r)   	old_field	new_fieldr6   edescriptionr+   s   &&&&&  r   r7    DatabaseSchemaEditor.alter_fieldH   s4   	G)D 	a&K k)[K-G11%INN +##EKK$8$8):J:JK  9EE +	0E0E0E((t(<11%INN +	0E0E0E((t(<  9E(((LL!=!=e!OPP ) 3	s:    E'+E"A	E"!E":%E"%E">AE"!E""E'c                  < \         P                  ! V4      pVP                  4       R9  Vn        V P	                  VP
                  4      Vn        V P                  W4       V P                  VP
                  4      pVP                  V P                  4      p\        P                  ! RV4      '       d   RV,          pRp\        P                  ! RV4      '       dL   VP                  4       pVR8X  d   RV,          pM*VR8X  d   RV,          pMVR	8X  d   R
V,          pRV,          pV P                  RV P                  VP                  P                  4      : RV P                  VP
                  4      : RV: 24       V P                  W4       \         SV `E  WV4       VP                  V P                  4      pVP$                  '       d   VP$                  '       g%   VP&                  '       d   VP&                  '       ds   Wh8w  dk   \)        WC4       FY  w  rV
P*                  P,                  '       g   K#  V P                  V P/                  V
P0                  V
P*                  R4      4       K[  	  R# R# R# R# )ay  
Oracle refuses to change from some type to other type.
What we need to do instead is:
- Add a nullable version of the desired field with a temporary name. If
  the new column is an auto field, then the temporary column can't be
  nullable.
- Update the table to transfer values from old to new
- Drop old column
- Rename the new column and possibly drop the nullable property
z^N?CLOBzTO_CHAR(%s)VARCHAR2z^N?VARCHAR2	DateFieldzTO_DATE(%s, 'YYYY-MM-DD')DateTimeFieldz,TO_TIMESTAMP(%s, 'YYYY-MM-DD HH24:MI:SS.FF')	TimeFieldzCONCAT('1900-01-01 ', %s)zUPDATE z set =_fkN)	AutoFieldBigAutoFieldSmallAutoField)copydeepcopyget_internal_typenull_generate_temp_namer%   	add_field
quote_namedb_typer1   rematchr0   r#   r$   r(   r'   r7   r9   uniquer   r*   db_constraint_create_fk_sqlrelated_model)r   r)   r<   r=   new_temp_field	new_valueold_typenew_internal_typenew_type_relr+   s   &&&&       r   r8   1DatabaseSchemaEditor._alter_field_type_workaroundf   s     y1'99; D
 

 !% 8 89I9I Ju- OOI$4$45	$$T__588Ix((%	1I!H88M8,, ) ; ; = K/7)C	"o5JYV	"k1 8)C	JYV	  4 45 5 56		
 	%+E9= $$T__5"""y'<'<'<   Y%5%5%5"2>M99***LL++C,=,=syy%P N # &6 r   c                N  < 0 RmpVP                  4       V9   d|   VP                  4       V9  dg   V P                  VP                  P                  VP                  4      '       d1   V P                  VP                  P                  VP                  4       \        SV `  WW4WV4      # )rH   >   rH   rI   rJ   )rM   r"   r#   r$   r%   r&   r'   _alter_column_type_sql)	r   r)   r<   r=   r]   old_collationnew_collationauto_field_typesr+   s	   &&&&&&& r   rb   +DatabaseSchemaEditor._alter_column_type_sql   s     K '')-==++-5EE(()=)=y?O?OPP 4 4i6F6FGw-i=
 	
r   c                j    V P                  V4      pV^ ,          R8X  d   VR,          R8X  d   V^R pV# )zj
Get the properly shortened and uppercased identifier as returned by
quote_name() but without the quotes.
")rQ   )r   namenns   && r   normalize_name#DatabaseSchemaEditor.normalize_name   s7    
 __T"a5C<BrFcMAbB	r   c                    \        \        V4      4      P                  4       R,          pV P                  VR,           V,           4      # )z@Generate temporary names for workarounds that need temp columns.:   NNr^   )r   hashupperrl   )r   for_namesuffixs   && r   rO   (DatabaseSchemaEditor._generate_temp_name   s8    T(^$**,R0""8c>F#:;;r   c                $    V P                  V4      # r!   )r   r   s   &&r   prepare_default$DatabaseSchemaEditor.prepare_default   s    &&r   c                   < \         SV `  W4      pVP                  V P                  4      pVe,   VP	                  4       V P                  P
                  9   d   R# V# )NF)r'   _field_should_be_indexedrR   r1   lower_limited_data_types)r   r)   r*   create_indexrR   r+   s   &&&  r   ry   -DatabaseSchemaEditor._field_should_be_indexed   sK    w7E--04??#F#FFr   c           	     B   V'       g   R # V P                   P                  4       ;_uu_ 4       pVP                  RV P                  V4      V P                  V4      .4       VP	                  4       pV'       d
   V^ ,          MR uuRRR4       #   + '       g   i     R# ; i)Fz
                SELECT
                    CASE WHEN identity_column = 'YES' THEN 1 ELSE 0 END
                FROM user_tab_cols
                WHERE table_name = %s AND
                      column_name = %s
                Nr1   cursorr0   rl   fetchone)r   
table_namecolumn_namer   rows   &&&  r   r"   (DatabaseSchemaEditor._is_identity_column   sv    __##%%NN $$Z0$2E2Ek2RS	 //#C 3q6e &%%%s   ABB	c           	     z    V P                  R RV P                  V4      RV P                  V4      /,          4       R# )z5ALTER TABLE %(table)s MODIFY %(column)s DROP IDENTITYtabler%   N)r0   rQ   )r   r   r   s   &&&r   r&   #DatabaseSchemaEditor._drop_identity   s7    C4$//+6	
r   c                    V P                   P                  4       ;_uu_ 4       pVP                  R V P                  V4      .4       VP	                  4       ^ ,          uuRRR4       #   + '       g   i     R# ; i)za
                SELECT default_collation FROM user_tables WHERE table_name = %s
                Nr   )r   r   r   s   && r   _get_default_collation+DatabaseSchemaEditor._get_default_collation   s[    __##%%NN $$Z01	 ??$Q' &%%%s   9A''A8	c                V   < Vf   Ve   V P                  V4      p\        SV `	  WV4      # r!   )r   r'   _collate_sql)r   	collationrc   r   r+   s   &&&&r   r   !DatabaseSchemaEditor._collate_sql   s0    !:33J?Iw#IjIIr    )F)NN)__name__
__module____qualname____firstlineno__sql_create_columnsql_alter_column_typesql_alter_column_nullsql_alter_column_not_nullsql_alter_column_defaultsql_alter_column_no_default sql_alter_column_no_default_nullsql_create_column_inline_fksql_delete_tablesql_create_indexr   r(   r/   r7   r8   rb   rl   rO   rv   ry   r"   r&   r   r   __static_attributes____classdictcell____classcell__)r+   __classdict__s   @@r   r   r      s     ME4 <F"B'B$ 	S   BR+
.<BH
<
',"
(J Jr   r   )rK   r   rS   	django.dbr   django.db.backends.base.schemar   r   django.utils.durationr   r   r   r   r   <module>r      s,      	 # 6oJ3 oJr   