HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/django/core/management/commands/__pycache__/flush.cpython-310.pyc
o

�a�
�@shddlmZddlmZddlmZmZddlmZddl	m
Z
mZddlm
Z
mZGdd�de�Zd	S)
�)�
import_module)�apps)�BaseCommand�CommandError)�no_style)�emit_post_migrate_signal�	sql_flush)�DEFAULT_DB_ALIAS�connectionsc@s$eZdZdZdZdd�Zdd�ZdS)�CommandzuRemoves ALL DATA from the database, including data added during migrations. Does not achieve a "fresh install" state.)�reset_sequences�
allow_cascade�inhibit_post_migratecCs(|jdddddd�|jdtdd	�dS)
Nz	--noinputz
--no-input�store_false�interactivez:Tells Django to NOT prompt the user for input of any kind.)�action�dest�helpz
--databasezBNominates a database to flush. Defaults to the "default" database.)�defaultr)�add_argumentr	)�self�parser�r�G/usr/lib/python3/dist-packages/django/core/management/commands/flush.py�
add_argumentss�
�zCommand.add_argumentsc

Ks"|d}t|}|d}|d}|�dd�}|�dd�}|�dd�}t�|_t��D]}	ztd	|	j�Wq*ty=Yq*wt	|j|||d
�}
|rSt
d|jd�}nd
}|d
kr�z|j�
|
�Wntyx}ztd|jdf�|�d}~ww|
r�|s�t|||�dSdSdS|j�d�dS)N�database�	verbosityrrTr
Frz.management)rr
z�You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the "%s" database,
and return each table to an empty state.
Are you sure you want to do this?

    Type 'yes' to continue, or 'no' to cancel: �NAME�yesa.Database %s couldn't be flushed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the expected database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.zFlush cancelled.)r
�getr�styler�get_app_configsr�name�ImportErrorr�input�
settings_dict�ops�execute_sql_flush�	Exceptionrr�stdout�write)
r�optionsr�
connectionrrrr
r�
app_config�sql_list�confirm�excrrr�handlesR������	���
�zCommand.handleN)�__name__�
__module__�__qualname__r�stealth_optionsrr1rrrrr
s�
rN)�	importlibr�django.appsr�django.core.management.baserr�django.core.management.colorr�django.core.management.sqlrr�	django.dbr	r
rrrrr�<module>s