ó
    ¼Rj'&  ã                   ó`   • S SK r S SKJr  S SKJr  SSKJr   " S S5      r " S S	\5      r	S
 r
g)é    N)Úget_migration_name_timestamp)Úatomicé   )ÚIrreversibleErrorc                   ór   • \ rS rSrSr/ r/ r/ r/ rSr	Sr
S rS rS rS rS	 rSS
 jrSS jrSS jrS rSrg)Ú	Migrationé	   ae  
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                 ó<  • Xl         X l        [        U R                  R                  5      U l        [        U R                  R
                  5      U l        [        U R                  R                  5      U l        [        U R                  R                  5      U l        g ©N)ÚnameÚ	app_labelÚlistÚ	__class__Ú
operationsÚdependenciesÚ
run_beforeÚreplaces)Úselfr   r   s      ÚJD:\diplom_project\venv\Lib\site-packages\django/db/migrations/migration.pyÚ__init__ÚMigration.__init__7   se   € ØŒ	Ø"Œä˜tŸ~™~×8Ñ8Ó9ˆŒÜ  §¡×!<Ñ!<Ó=ˆÔÜ˜tŸ~™~×8Ñ8Ó9ˆŒÜ˜TŸ^™^×4Ñ4Ó5ˆ�ó    c                 ó¢   • [        U[        5      =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r   )Ú
isinstancer   r   r   )r   Úothers     r   Ú__eq__ÚMigration.__eq__@   s;   € ä�uœiÓ(÷ 2Ø—	‘	˜UŸZ™ZÑ'÷2à—‘ %§/¡/Ñ1ð	
r   c                 ó@   • SU R                   < SU R                  < S3$ )Nz<Migration Ú.Ú>©r   r   ©r   s    r   Ú__repr__ÚMigration.__repr__G   s   � Ø&*§n¤n°d·i´iÐ@Ð@r   c                 ó<   • U R                   < SU R                  < 3$ ©Nr   r!   r"   s    r   Ú__str__ÚMigration.__str__J   s   € ØŸ.œ.¨$¯)«)Ð4Ð4r   c                 óN   • [        U R                  < SU R                  < 35      $ r&   )Úhashr   r   r"   s    r   Ú__hash__ÚMigration.__hash__M   s   € Ü˜tŸ~œ~¨t¯y«yÐ9Ó:Ð:r   c                 ó–   • UnU(       a  UR                  5       nU R                   H  nUR                  U R                  U5        M!     U$ )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_stateÚMigration.mutate_stateP   sB   € ð "ˆ	ÞØ%×+Ñ+Ó-ˆIàŸœˆIØ×$Ñ$ T§^¡^°YÖ?ñ )àÐr   c                 óâ  • U R                    GHÌ  nU(       a¥  UR                  R                  S5        UR                  R                  SUR                  5       -  5        UR                  R                  S5        UR                  (       d  UR                  R                  S5        M›  [        UR                  5      nUR                  5       nUR                  U R                  U5        UR                  =(       d!    U R                  =(       a    UR                  SLnUR                  (       dM  U(       aF  [        UR                  R                  5         UR                  U R                  X&U5        SSS5        OUR                  U R                  X&U5        U(       d  GM•  W[        UR                  5      :X  d  GM±  UR                  R                  S5        GMÏ     U$ ! , (       d  f       NV= f)zê
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   r0   Úschema_editorÚcollect_sqlr3   Úcollected_sql_beforeÚ	old_stateÚatomic_operations           r   ÚapplyÚMigration.apply^   s„  € ð Ÿ�ˆ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×:Ñ:Õ;Ø×/Ñ/ØŸ™¨À-ô÷ <Ð;ð ×+Ñ+Ø—N‘N M¸mô÷ ‰{Ð3´s¸=×;VÑ;VÓ7WÖWØ×+Ñ+×2Ñ2°<×@ñC )ðD Ð÷ <Õ;ús   ÅG Ç 
G.	c                 ó”  • / nUnU R                    Hx  nUR                  (       d  [        SU< SU < S35      eUR                  5       nUR                  5       nUR	                  U R
                  U5        UR                  SXgU45        Mz     U GH£  u  phn	U(       a¥  UR                  R                  S5        UR                  R                  SUR                  5       -  5        UR                  R                  S5        UR                  (       d  UR                  R                  S5        Mž  [        UR                  5      n
UR                  =(       d!    U R                  =(       a    UR                  SLnUR                  (       dM  U(       aF  [        UR                  R                  5         UR!                  U R
                  X)U5        S	S	S	5        OUR!                  U R
                  X)U5        U(       d  GMl  W
[        UR                  5      :X  d  GMˆ  UR                  R                  S
5        GM¦     U$ ! , (       d  f       NV= f)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   r7   r8   r9   FNr:   )r   Ú
reversibler   r.   r/   r   Úinsertr;   r<   r=   r>   r?   r   r@   rA   rB   Údatabase_backwards)r   r0   rD   rE   Úto_runr2   r3   rG   Úto_stateÚ
from_staterF   rH   s               r   ÚunapplyÚMigration.unapply‹   sØ  € ð ˆØ!ˆ	àŸœˆIà×'×'Ý'Û>GËÐNóð ð
 "Ÿ™Ó)ˆIØ!Ÿ™Ó)ˆIØ×$Ñ$ T§^¡^°YÔ?Ø�M‰M˜!˜i°IÐ>Ö?ñ )ô 06Ñ+ˆI ÞØ×+Ñ+×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ØŸ™¨À8ô÷ <Ð;ð ×,Ñ,Ø—N‘N M¸xô÷ ‰{Ð3´s¸=×;VÑ;VÓ7WÖWØ×+Ñ+×2Ñ2°<×@ñ7 06ð8 Ð÷ <Õ;ús   Æ-H9È9
I	c                 ó¶  • U R                   (       a  gU R                   Vs/ s H  oR                  PM     nnU Vs/ s H#  o3(       d  M  [        R                  " SSU5      PM%     nnU(       a"  [        U5      [        U R                  5      :w  a  S[        5       -  $ US   nUSS  H#  nU SU 3n[        U5      S:”  a  U S	3n  U$ UnM%     U$ s  snf s  snf )
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)rU   r   Úmigration_name_fragmentÚreÚsubr?   r   )r   ÚopÚraw_fragmentsr   Ú	fragmentsÚfragmentÚnew_names          r   Úsuggest_nameÚMigration.suggest_nameÈ   sÖ   € ð �<�<Øà>B¿oºoÓNºo¸×3Ô3¹oˆÐNÙ;HÓQº=°4ËDÓ.”R—V’V˜F C¨Ö.¹=ˆ	ÐQæœC 	›N¬c°$·/±/Ó.BÓBØÔ;Ó=Ñ=Ð=à˜‰|ˆØ! ! "›ˆHØ˜˜q  
Ð+ˆHÜ�8‹}˜rÓ!Ø˜˜yÐ)�Øàˆð ŠDñ &ð ˆùò OùÚQs   ¡C¼
CÁ
C)r   r   r   r   r   r   )T)F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r   rU   r   r   r   r#   r'   r+   r4   rI   rR   ra   Ú__static_attributes__© r   r   r   r   	   sa   † ñð$ €Jð €Lð
 €Jð
 €Hð €Gð €Fò6ò
òAò5ò;ôô+ôZ;õzr   r   c                   ó   • \ rS rSrSrS rSrg)ÚSwappableTupleéá   zs
Subclass of tuple so Django can tell this was originally a swappable
dependency when it reads the migration file.
c                 ó<   • [         R                  X5      nX#l        U$ r   )ÚtupleÚ__new__Úsetting)ÚclsÚvaluerp   r   s       r   ro   ÚSwappableTuple.__new__ç   s   € Ü�}‰}˜SÓ(ˆØŒØˆr   )rp   N)rc   rd   re   rf   rg   ro   rh   ri   r   r   rk   rk   á   s   † ñõ
r   rk   c                 óD   • [        U R                  SS5      S   S4U 5      $ )z'Turn a setting value into a dependency.r   r   r   Ú	__first__)rk   Úsplit)rr   s    r   Úswappable_dependencyrw   í   s$   € ä˜5Ÿ;™; s¨AÓ.¨qÑ1°;Ð?ÀÓGÐGr   )rZ   Údjango.db.migrations.utilsr   Údjango.db.transactionr   Ú
exceptionsr   r   rn   rk   rw   ri   r   r   Ú<module>r{      s0   ðÛ 	å CÝ (å )÷Uñ Uôp	�Uô 	óHr   