§
    kÍâh<  ã                   óz   — d Z ddlZddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ  G d	„ d
e¦  «        ZdS )z°
Recreates the public schema for current database (PostgreSQL only).
Useful for Docker environments where you need to reset database
schema while there are active connections.
é    N)ÚBaseCommandÚCommandError)ÚDEFAULT_DB_ALIAS)Úconnections)Úsettings)ÚPOSTGRESQL_ENGINES)ÚRemovedInNextVersionWarningc                   ó,   ‡ — e Zd ZdZdZˆ fd„Zd„ Zˆ xZS )ÚCommandz&`reset_schema` command implementation.z-Recreates the public schema for this project.c                 ó@  •— t          ¦   «                              |¦  «         |                     dddddd¬¦  «         |                     dd	d
dt          d¬¦  «         |                     dt          dt          z  ¬¦  «         |                     ddd
ddd¬¦  «         d S )Nz	--noinputz
--no-inputÚstore_falseÚinteractiveTz:Tells Django to NOT prompt the user for input of any kind.)ÚactionÚdestÚdefaultÚhelpz-Rz--routerÚstoreÚrouterzBUse this router-database instead of the one defined in settings.pyz
--databasez>Nominates a database to run command for. Defaults to the "%s".)r   r   z-Sz--schemaÚschemaÚpublicz$Drop this schema instead of "public")ÚsuperÚadd_argumentsÚadd_argumentr   )ÚselfÚparserÚ	__class__s     €úi/var/www/histauto/venv/lib/python3.11/site-packages/django_extensions/management/commands/reset_schema.pyr   zCommand.add_arguments   sæ   ø€ Ý‰Œ×Ò˜fÑ%Ô%Ð%Ø×ÒØØØ ØØØMð 	ñ 	
ô 	
ð 	
ð 	×ÒØØØØÝ$ØUð 	ñ 	
ô 	
ð 	
ð 	×ÒØÝ$ØQÝñð 	ñ 	
ô 	
ð 	
ð 	×ÒØØØØØØ7ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    c                 óú  — |d         }|d         t           k    r$t          j        dt          d¬¦  «         |d         }t          j                             |¦  «        }|€t          d|z  ¦  «        ‚|                     d¦  «        }|t          vrt          d¦  «        ‚|d	         }|d
         }|d         r$t          d 
                    ||¦  «        ¦  «        }nd}|dk    rt          d¦  «         d S t          |                              ¦   «         5 }	|	                     d 
                    |¦  «        ¦  «         |	                     d 
                    |¦  «        ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )NÚdatabaser   z2--router is deprecated. You should use --database.é   )Ú
stacklevelzUnknown database %sÚENGINEz8This command can be used only with PostgreSQL databases.ÚNAMEr   r   zÈ
You have requested a database schema reset.
This will IRREVERSIBLY DESTROY ALL data
in the "{}" schema of database "{}".
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: ÚyeszReset cancelled.zDROP SCHEMA {} CASCADEzCREATE SCHEMA {})r   ÚwarningsÚwarnr	   r   Ú	DATABASESÚgetr   r   ÚinputÚformatÚprintr   ÚcursorÚexecute)
r   ÚargsÚoptionsr    ÚdbinfoÚengineÚdatabase_namer   Úconfirmr-   s
             r   ÚhandlezCommand.handle9   sÕ  € Ø˜:Ô&ˆØ�8ÔÕ 0Ò0Ð0ÝŒMØDÝ+Øðñ ô ð ð
 ˜xÔ(ˆHåÔ#×'Ò'¨Ñ1Ô1ˆØˆ>ÝÐ4°xÑ?Ñ@Ô@Ð@à—’˜HÑ%Ô%ˆØÕ+Ð+Ð+ÝØJñô ð ð ˜vœˆà˜Ô"ˆà�=Ô!ð 	Ýð/÷ 06ªv°f¸mÑ/LÔ/Lñô ˆGˆGð ˆGà�eÒÐÝÐ$Ñ%Ô%Ð%ØˆFå˜Ô"×)Ò)Ñ+Ô+ð 	>¨vØ�NŠNÐ3×:Ò:¸6ÑBÔBÑCÔCÐCØ�NŠNÐ-×4Ò4°VÑ<Ô<Ñ=Ô=Ð=ð	>ð 	>ð 	>ñ 	>ô 	>ð 	>ð 	>ð 	>ð 	>ð 	>ð 	>ð 	>øøøð 	>ð 	>ð 	>ð 	>ð 	>ð 	>s   ÄAE0Å0E4Å7E4)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r5   Ú__classcell__)r   s   @r   r   r      sS   ø€ € € € € Ø0Ð0à:€Dð
ð 
ð 
ð 
ð 
ðB+>ð +>ð +>ð +>ð +>ð +>ð +>r   r   )r9   r&   Údjango.core.managementr   r   Ú	django.dbr   r   Údjango.confr   Údjango_extensions.settingsr   Ú#django_extensions.utils.deprecationr	   r   © r   r   ú<module>rA      sÊ   ððð ð €€€à <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ø &Ð &Ð &Ð &Ð &Ð &Ø !Ð !Ð !Ð !Ð !Ð !Ø  Ð  Ð  Ð  Ð  Ð  à 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø KÐ KÐ KÐ KÐ KÐ KðQ>ð Q>ð Q>ð Q>ð Q>ˆkñ Q>ô Q>ð Q>ð Q>ð Q>r   