Ë
    ¹ûàg'&  ã                   ó`   — d dl Z d dlmZ d dlmZ ddlmZ  G d„ d«      Z G d„ d	e«      Z	d
„ Z
y)é    N)Úget_migration_name_timestamp)Úatomicé   )ÚIrreversibleErrorc                   ód   — e Zd ZdZg Zg Zg Zg ZdZdZ	d„ Z
d„ Zd„ Zd„ Zd„ Zdd	„Zdd
„Zdd„Zd„ Zy)Ú	Migrationa•  
    The base class for all migrations.

    Migration files will import this from django.db.migrations.Migration
    and subclass it as a class called Migration. It will have one or more
    of the following attributes:

     - operations: A list of Operation instances, probably from
       django.db.migrations.operations
     - dependencies: A list of tuples of (app_path, migration_name)
     - run_before: A list of tuples of (app_path, migration_name)
     - replaces: A list of migration_names

    Note that all migrations come out of migrations and into the Loader or
    Graph as instances, having been initialized with their app label and name.
    NTc                 ó@  — || _         || _        t        | j                  j                  «      | _        t        | j                  j
                  «      | _        t        | j                  j                  «      | _        t        | j                  j                  «      | _        y ©N)ÚnameÚ	app_labelÚlistÚ	__class__Ú
operationsÚdependenciesÚ
run_beforeÚreplaces)Úselfr   r   s      ú\/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/db/migrations/migration.pyÚ__init__zMigration.__init__7   si   € ØˆŒ	Ø"ˆŒä˜tŸ~™~×8Ñ8Ó9ˆŒÜ  §¡×!<Ñ!<Ó=ˆÔÜ˜tŸ~™~×8Ñ8Ó9ˆŒÜ˜TŸ^™^×4Ñ4Ó5ˆ�ó    c                 óŽ   — t        |t        «      xr4 | j                  |j                  k(  xr | j                  |j                  k(  S r
   )Ú
isinstancer   r   r   )r   Úothers     r   Ú__eq__zMigration.__eq__@   s;   € ä�uœiÓ(ò 2Ø—	‘	˜UŸZ™ZÑ'ò2à—‘ %§/¡/Ñ1ð	
r   c                 ó<   — d| j                   ›d| j                  ›d�S )Nz<Migration ú.ú>©r   r   ©r   s    r   Ú__repr__zMigration.__repr__G   s   � Ø&*§n£n°d·i³iÐ@Ð@r   c                 ó8   — | j                   ›d| j                  ›�S ©Nr   r   r   s    r   Ú__str__zMigration.__str__J   s   € ØŸ.›.¨$¯)ª)Ð4Ð4r   c                 óJ   — t        | j                  ›d| j                  ›�«      S r"   )Úhashr   r   r   s    r   Ú__hash__zMigration.__hash__M   s   € Ü˜tŸ~›~¨t¯yªyÐ9Ó:Ð:r   c                 óˆ   — |}|r|j                  «       }| j                  D ]  }|j                  | j                  |«       Œ  |S )zÏ
        Take a ProjectState and return a new one with the migration's
        operations applied to it. Preserve the original object state by
        default and return a mutated state from a copy.
        )Úcloner   Ústate_forwardsr   )r   Úproject_stateÚpreserveÚ	new_stateÚ	operations        r   Úmutate_statezMigration.mutate_stateP   sI   € ð "ˆ	ÙØ%×+Ñ+Ó-ˆIàŸ™ò 	@ˆIØ×$Ñ$ T§^¡^°YÕ?ð	@àÐr   c                 óŠ  — | j                   D �]¦  }|rŸ|j                  j                  d«       |j                  j                  d|j                  «       z  «       |j                  j                  d«       |j                  s|j                  j                  d«       Œ�t        |j                  «      }|j                  «       }|j                  | j                  |«       |j                  xs | j                  xr |j                  du}|j                  sI|rGt        |j                  j                  «      5  |j                  | j                  |||«       ddd«       n|j                  | j                  |||«       |s�Œrt        |j                  «      k(  s�ŒŒ|j                  j                  d«       �Œ© |S # 1 sw Y   ŒGxY w)a  
        Take a project_state representing all migrations prior to this one
        and a schema_editor for a live database and apply the migration
        in a forwards order.

        Return the resulting project state for efficient reuse by following
        Migrations.
        ú--ú-- %sú*-- THIS OPERATION CANNOT BE WRITTEN AS SQLFNú
-- (no-op))r   Úcollected_sqlÚappendÚdescribeÚreduces_to_sqlÚlenr(   r)   r   r   Úatomic_migrationÚ
connectionÚaliasÚdatabase_forwards)r   r*   Úschema_editorÚcollect_sqlr-   Úcollected_sql_beforeÚ	old_stateÚatomic_operations           r   ÚapplyzMigration.apply^   s–  € ð Ÿ™ó !	AˆIñ Ø×+Ñ+×2Ñ2°4Ô8Ø×+Ñ+×2Ñ2°7¸Y×=OÑ=OÓ=QÑ3QÔRØ×+Ñ+×2Ñ2°4Ô8Ø ×/Ò/Ø!×/Ñ/×6Ñ6ØDôð Ü'*¨=×+FÑ+FÓ'GÐ$à%×+Ñ+Ó-ˆIØ×$Ñ$ T§^¡^°]ÔCà(×/Ñ/ò  Ø—‘Ò= 	× 0Ñ 0¸Ð =ð ð !×1Ò1Ñ6Fô ˜M×4Ñ4×:Ñ:Ó;ñ Ø×/Ñ/ØŸ™¨°yÀ-ô÷ð ð ×+Ñ+Ø—N‘N M°9¸môó Ð3´s¸=×;VÑ;VÓ7WÔWØ×+Ñ+×2Ñ2°<Ö@ðC!	AðD Ð÷ð ús   Ä5F9Æ9G	c                 ó.  — g }|}| j                   D ]q  }|j                  st        d|›d| ›d�«      ‚|j                  «       }|j                  «       }|j	                  | j
                  |«       |j                  d|||f«       Œs |D �]~  \  }}}	|rŸ|j                  j                  d«       |j                  j                  d|j                  «       z  «       |j                  j                  d«       |j                  s|j                  j                  d«       Œ”t        |j                  «      }
|j                  xs | j                  xr |j                  du}|j                  sI|rGt        |j                  j                  «      5  |j!                  | j
                  ||	|«       d	d	d	«       n|j!                  | j
                  ||	|«       |s�ŒJ
t        |j                  «      k(  s�Œd|j                  j                  d
«       �Œ� |S # 1 sw Y   ŒGxY w)aõ  
        Take a project_state representing all migrations prior to this one
        and a schema_editor for a live database and apply the migration
        in a reverse order.

        The backwards migration process consists of two phases:

        1. The intermediate states from right before the first until right
           after the last operation inside this migration are preserved.
        2. The operations are applied in reverse order using the states
           recorded in step 1.
        z
Operation z in z is not reversibler   r0   r1   r2   FNr3   )r   Ú
reversibler   r(   r)   r   Úinsertr4   r5   r6   r7   r8   r   r9   r:   r;   Údatabase_backwards)r   r*   r=   r>   Úto_runr,   r-   r@   Úto_stateÚ
from_stater?   rA   s               r   ÚunapplyzMigration.unapply‹   sõ  € ð ˆØ!ˆ	àŸ™ò 	@ˆIà×'Ò'Ý'Ú>GÊÐNóð ð
 "Ÿ™Ó)ˆIØ!Ÿ™Ó)ˆIØ×$Ñ$ T§^¡^°YÔ?Ø�M‰M˜!˜i¨°IÐ>Õ?ð	@ð 06ó 	AÑ+ˆI�x ÙØ×+Ñ+×2Ñ2°4Ô8Ø×+Ñ+×2Ñ2°7¸Y×=OÑ=OÓ=QÑ3QÔRØ×+Ñ+×2Ñ2°4Ô8Ø ×/Ò/Ø!×/Ñ/×6Ñ6ØDôð Ü'*¨=×+FÑ+FÓ'GÐ$Ø(×/Ñ/ò  Ø—‘Ò= 	× 0Ñ 0¸Ð =ð ð !×1Ò1Ñ6Fô ˜M×4Ñ4×:Ñ:Ó;ñ Ø×0Ñ0ØŸ™¨°zÀ8ô÷ð ð ×,Ñ,Ø—N‘N M°:¸xôó Ð3´s¸=×;VÑ;VÓ7WÔWØ×+Ñ+×2Ñ2°<Ö@ð7	Að8 Ð÷ð ús   ÆHÈH	c                 ó„  — | j                   ry| j                  D �cg c]  }|j                  ‘Œ }}|D �cg c]  }|sŒt        j                  dd|«      ‘Œ }}|r!t        |«      t        | j                  «      k7  rdt        «       z  S |d   }|dd D ]!  }|› d|› �}t        |«      dkD  r|› d	�} |S |}Œ# |S c c}w c c}w )
zÙ
        Suggest a name for the operations this migration might represent. Names
        are not guaranteed to be unique, but put some effort into the fallback
        name to avoid VCS conflicts if possible.
        Úinitialz\W+Ú_zauto_%sr   r   Né4   Ú	_and_more)rL   r   Úmigration_name_fragmentÚreÚsubr8   r   )r   ÚopÚraw_fragmentsr   Ú	fragmentsÚfragmentÚnew_names          r   Úsuggest_namezMigration.suggest_nameÈ   sØ   € ð �<Š<Øà>B¿o¹oÖN¸˜×3Ó3ÐNˆÐNØ;HÖQ°4ÊD”R—V‘V˜F C¨Õ.ÐQˆ	ÐQáœC 	›N¬c°$·/±/Ó.BÒBØÔ;Ó=Ñ=Ð=à˜‰|ˆØ! ! "˜ò 	ˆHØ˜˜q  
Ð+ˆHÜ�8‹}˜rÒ!Ø˜˜yÐ)�Øàˆð ‰Dð	ð ˆùò OùÚQs   œB8µB=½B=)T)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   rL   r   r   r   r    r#   r&   r.   rB   rJ   rX   © r   r   r   r   	   sa   „ ñð$ €Jð €Lð
 €Jð
 €Hð €Gð €Fò6ò
òAò5ò;óó+óZ;ózr   r   c                   ó   — e Zd ZdZd„ Zy)ÚSwappableTuplez
    Subclass of tuple so Django can tell this was originally a swappable
    dependency when it reads the migration file.
    c                 ó@   — t         j                  | |«      }||_        |S r
   )ÚtupleÚ__new__Úsetting)ÚclsÚvaluerc   r   s       r   rb   zSwappableTuple.__new__ç   s   € Ü�}‰}˜S %Ó(ˆØˆŒØˆr   N)rY   rZ   r[   r\   rb   r]   r   r   r_   r_   á   s   „ ñó
r   r_   c                 óD   — t        | j                  dd«      d   df| «      S )z'Turn a setting value into a dependency.r   r   r   Ú	__first__)r_   Úsplit)re   s    r   Úswappable_dependencyri   í   s$   € ä˜5Ÿ;™; s¨AÓ.¨qÑ1°;Ð?ÀÓGÐGr   )rQ   Údjango.db.migrations.utilsr   Údjango.db.transactionr   Ú
exceptionsr   r   ra   r_   ri   r]   r   r   ú<module>rm      s0   ðÛ 	å CÝ (å )÷Uñ Uôp	�Uô 	óHr   