
    h                     X    S SK r S SKJr   " S S\\ R                  5      r " S S5      rg)    N)routerc                   ,    \ rS rSrSrSrSrSrSrSr	Sr
g	)
OperationCategory   +-~ps? N)__name__
__module____qualname____firstlineno__ADDITIONREMOVAL
ALTERATIONPYTHONSQLMIXED__static_attributes__r       V/var/www/html/env/lib/python3.13/site-packages/django/db/migrations/operations/base.pyr   r      s     HGJF
CEr   r   c                       \ rS rSrSrSrSrSrSr/ r	Sr
S rS rS rS	 rS
 rS rS r\S 5       rS rS rS rS rS rSrg)	Operation   a  
Base class for migration operations.

It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it against a live database.

Note that some operations won't modify memory state at all (e.g. data
copying operations), and some will need their modifications to be
optionally specified by the user (e.g. custom Python code snippets)

Due to the way this class deals with deconstruction, it should be
considered immutable.
TFNc                 @    [         R                  U 5      nX4Ul        U$ )N)object__new___constructor_args)clsargskwargsselfs       r   r    Operation.__new__1   s    ~~c""&r   c                 h    U R                   R                  U R                  S   U R                  S   4$ )z
Return a 3-tuple of class import path (or just name if it lives
under django.db.migrations), positional arguments, and keyword
arguments.
r      	__class__r   r!   r%   s    r   deconstructOperation.deconstruct7   s7     NN##""1%""1%
 	
r   c                     [        S5      e)zq
Take the state from the previous migration, and mutate it
so that it matches what this migration would perform.
z>subclasses of Operation must provide a state_forwards() methodNotImplementedError)r%   	app_labelstates      r   state_forwardsOperation.state_forwardsC   s    
 "L
 	
r   c                     [        S5      e)zQ
Perform the mutation on the database schema in the normal
(forwards) direction.
zAsubclasses of Operation must provide a database_forwards() methodr/   r%   r1   schema_editor
from_stateto_states        r   database_forwardsOperation.database_forwardsL   s    
 "O
 	
r   c                     [        S5      e)z
Perform the mutation on the database schema in the reverse
direction - e.g. if this were CreateModel, it would in fact
drop the model's table.
zBsubclasses of Operation must provide a database_backwards() methodr/   r6   s        r   database_backwardsOperation.database_backwardsU   s     "P
 	
r   c                 P    U R                   R                  < SU R                  < 3$ )z1
Output a brief summary of what the action does.
z: r)   r+   s    r   describeOperation.describe_   s      >>22D4J4JKKr   c                     U R                  5       nU R                  c  [        R                  R                   SU 3$ U R                  R                   SU 3$ )z3Output a description prefixed by a category symbol. )r@   categoryr   r   value)r%   descriptions     r   formatted_descriptionOperation.formatted_descriptione   sQ    mmo== '--334Ak]CC--%%&a}55r   c                     g)zu
A filename part suitable for automatically naming a migration
containing this operation, or None if not applicable.
Nr   r+   s    r   migration_name_fragment!Operation.migration_name_fragmentl   s     r   c                     g)aU  
Return True if there is a chance this operation references the given
model name (as a string), with an app label for accuracy.

Used for optimization. If in doubt, return True;
returning a false positive will merely make the optimizer a little
less efficient, while returning a false negative may result in an
unusable optimized migration.
Tr   )r%   namer1   s      r   references_modelOperation.references_modelt   s     r   c                 $    U R                  X5      $ )z
Return True if there is a chance this operation references the given
field name, with an app label for accuracy.

Used for optimization. If in doubt, return True.
)rN   )r%   
model_namerM   r1   s       r   references_fieldOperation.references_field   s     $$Z;;r   c                 p    UR                   R                  U5      (       d  g[        R                  " X5      $ )z
Return whether or not a model may be migrated.

This is a thin wrapper around router.allow_migrate_model() that
preemptively rejects any proxy, swapped out, or unmanaged model.
F)_metacan_migrater   allow_migrate_model)r%   connection_aliasmodels      r   rW   Operation.allow_migrate_model   s/     {{&&'788))*:BBr   c                 T    U R                   (       a  U/$ UR                   (       a  U /$ g)z
Return either a list of operations the actual operation should be
replaced with or a boolean that indicates whether or not the specified
operation can be optimized across.
F)elidable)r%   	operationr1   s      r   reduceOperation.reduce   s&     ==;6Mr   c           
          SU R                   R                  < SSR                  [        [        U R
                  S   5      5      < SR                  S U R
                  S   R                  5        5       5      < S3$ )	N<rC   z, r   ,c              3   ,   #    U  H
  nS U-  v   M     g7f)z %s=%rNr   ).0xs     r   	<genexpr>%Operation.__repr__.<locals>.<genexpr>   s     M+LaX\+Ls   r(   >)r*   r   joinmapreprr!   itemsr+   s    r   __repr__Operation.__repr__   s]    NN##IIc$ 6 6q 9:;HHM4+A+A!+D+J+J+LMM
 	
r   )r!   )r   r   r   r   __doc__
reversiblereduces_to_sqlatomicr\   serialization_expand_argsrD   r    r,   r3   r:   r=   r@   rG   propertyrJ   rN   rR   rW   r^   rm   r   r   r   r   r   r      s    " J N F H "H




L6  
<
C

r   r   )enum	django.dbr   strEnumr   r   r   r   r   <module>ry      s)     TYY W
 W
r   