
    g                     X    d dl Z d dlmZ  G d dee j                        Z G d d      Zy)    N)routerc                   $    e Zd ZdZdZdZdZdZdZy)OperationCategory+-~ps?N)	__name__
__module____qualname__ADDITIONREMOVAL
ALTERATIONPYTHONSQLMIXED     |/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/db/migrations/operations/base.pyr   r      s     HGJF
CEr   r   c                       e Zd ZdZdZdZdZdZg ZdZ	d Z
d Zd Zd Zd	 Zd
 Zd Zed        Zd Zd Zd Zd Zd Zy)	Operationa)  
    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                 B    t         j                  |       }||f|_        |S )N)object__new___constructor_args)clsargskwargsselfs       r   r   zOperation.__new__1   s!    ~~c""&r   c                 h    | j                   j                  | j                  d   | j                  d   fS )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   deconstructzOperation.deconstruct7   s7     NN##""1%""1%
 	
r   c                     t        d      )z
        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_forwardszOperation.state_forwardsC   s    
 "L
 	
r   c                     t        d      )zi
        Perform the mutation on the database schema in the normal
        (forwards) direction.
        zAsubclasses of Operation must provide a database_forwards() methodr)   r!   r+   schema_editor
from_stateto_states        r   database_forwardszOperation.database_forwardsL   s    
 "O
 	
r   c                     t        d      )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)   r/   s        r   database_backwardszOperation.database_backwardsU   s     "P
 	
r   c                 L    | j                   j                  d| j                  S )zA
        Output a brief summary of what the action does.
        z: r$   r&   s    r   describezOperation.describe_   s      >>22D4J4JKKr   c                     | j                         }| j                  t        j                  j                   d| S | j                  j                   d| S )z3Output a description prefixed by a category symbol. )r7   categoryr   r   value)r!   descriptions     r   formatted_descriptionzOperation.formatted_descriptione   sQ    mmo== '--334Ak]CC--%%&a}55r   c                      y)z
        A filename part suitable for automatically naming a migration
        containing this operation, or None if not applicable.
        Nr   r&   s    r   migration_name_fragmentz!Operation.migration_name_fragmentl   s     r   c                      y)a  
        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!   namer+   s      r   references_modelzOperation.references_modelt   s     r   c                 &    | j                  ||      S )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.
        )rB   )r!   
model_namerA   r+   s       r   references_fieldzOperation.references_field   s     $$Z;;r   c                 f    |j                   j                  |      syt        j                  ||      S )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   rI   zOperation.allow_migrate_model   s.     {{&&'78))*:EBBr   c                 @    | j                   r|gS |j                   r| gS y)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!   	operationr+   s      r   reducezOperation.reduce   s&     ==;6Mr   c           
          d| j                   j                  ddj                  t        t        | j
                  d               dj                  d | j
                  d   j                         D              dS )	N<r9   z, r   ,c              3   &   K   | ]	  }d |z    yw)z %s=%rNr   ).0xs     r   	<genexpr>z%Operation.__repr__.<locals>.<genexpr>   s     M+LaX\+Ls   r#   >)r%   r   joinmapreprr   itemsr&   s    r   __repr__zOperation.__repr__   s]    NN##IIc$ 6 6q 9:;HHM4+A+A!+D+J+J+LMM
 	
r   )r   r   r   __doc__
reversiblereduces_to_sqlatomicrM   serialization_expand_argsr:   r   r'   r-   r3   r5   r7   r=   propertyr?   rB   rE   rI   rO   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>rg      s)     TYY W
 W
r   