o
    8c
'                     @   s  d dl 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 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 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 e   dd Z!e!" edd Ze!" e j#ddddde j#dddde j#ddddde j#d dd!ded"d# Ze!" e j#ddddde j#d$d%dd&de j#d'dd(de j#d)dd*de j#d+d,d-de j#d.dd/de j#d0dd1de j#d2dd3de j#d4dd5ded6d7 Ze!" e j#ddddde j#d$d%dd&de j#d)dd*de j#d+d,d-de j#d.dd/de j#d0dd1de j#d2dd3de j#d4dd5de j#d8d9dd:d;ed<d= Z
e!" e j#ddddde j$d7d,d>ed?d@ Ze!" e j#ddddde j#d$d%ddAde j#d0dd1de j#d4dd5de j$dBdCdDedEdF Ze!" e j#ddddde j#d)dd*de j#dGddHde j#d8d9dd:d;e j$d7d,d>edIdJ Ze!" e j#ddddde j#d)dd*de j#dGddHde j#d8d9dd:d;e j$d7dKd>edLdM Ze!" e j#ddddde j$d7d,d>edNdO Ze!" e j#ddddde j#dPdQddRde j#dSdTddUde j#dVdWddXdedYdZ Ze!" e j#ddddde j#dSdTddUde j#d[dd\ded]d^ Ze!" e j#ddddde j#dSdTddUded_d` Ze!" e j#ddddde j#dSdTddUdedadb Ze!" e j#ddddde j#d)dd*de j#dGddHde j$d7d,d>edcdd ZdS )e    N)with_appcontext)list_templates)init)revision)migrate)edit)merge)upgrade)	downgrade)show)history)heads)branches)current)stampc                   C   s   dS )zPerform database migrations.N r   r   r   G/var/www/html/gps/gps/lib/python3.10/site-packages/flask_migrate/cli.pydb   s   r   c                   C   s
   t   dS )zList available templates.N)_list_templatesr   r   r   r   r      s   
r   z-dz--directoryz4Migration script directory (default is "migrations"))defaulthelpz	--multidbTzSupport multiple databases)is_flagr   z-tz
--templatez/Repository template to use (default is "flask")z	--packagezFWrite empty __init__.py files to the environment and version locationsc                 C      t | ||| dS )z#Creates a new migration repository.N)_init)	directorymultidbtemplatepackager   r   r   r       s   r   z-mz	--messagezRevision messagez--autogeneratezfPopulate revision script with candidate migration operations, based on comparison of database to modelz--sqlz<Don't emit SQL to database - dump to standard output insteadz--headheadzBSpecify head revision or <branchname>@head to base new revision onz--splicez6Allow a non-head revision as the "head" to splice ontoz--branch-labelz3Specify a branch label to apply to the new revisionz--version-pathz2Specify specific path from config for version filez--rev-idz9Specify a hardcoded revision id instead of generating onec	           	   
   C      t | ||||||||	 dS )zCreate a new revision file.N)	_revision)	r   messageautogeneratesqlr   splicebranch_labelversion_pathrev_idr   r   r   r   0   s   r   z-xz--x-argz6Additional arguments consumed by custom env.py scripts)multipler   c	           	   
   C   r   )zJAutogenerate a new revision file (Alias for
    'revision --autogenerate')N)_migrate)	r   r!   r#   r   r$   r%   r&   r'   x_argr   r   r   r   N   s   r   )r   c                 C      t | | dS )zEdit a revision fileN)_editr   r   r   r   r   r   l      r   zMerge revision message	revisions)nargsc                 C      t | |||| dS )z:Merge two revisions together, creating a new revision fileN)_merge)r   r!   r%   r'   r/   r   r   r   r   v   s   r   z--tagz;Arbitrary "tag" name - can be used by custom env.py scriptsc                 C   r2   )zUpgrade to a later versionN)_upgrader   r#   tagr*   r   r   r   r   r	         r	   z-1c                 C   r2   )zRevert to a previous versionN)
_downgrader5   r   r   r   r
      r7   r
   c                 C   r+   )z.Show the revision denoted by the given symbol.N)_showr-   r   r   r   r      r.   r   z-rz--rev-rangez1Specify a revision range; format is [start]:[end]z-vz	--verbosezUse more verbose outputz-iz--indicate-currentz?Indicate current version (Alembic 0.9.9 or greater is required)c                 C   r   )z.List changeset scripts in chronological order.N)_history)r   	rev_rangeverboseindicate_currentr   r   r   r      s   r   z--resolve-dependenciesz+Treat dependency versions as down revisionsc                 C   s   t | || dS )z4Show current available heads in the script directoryN)_heads)r   r<   resolve_dependenciesr   r   r   r      s   	r   c                 C   r+   )zShow current branch pointsN)	_branchesr   r<   r   r   r   r      r.   r   c                 C   r+   )z/Display the current revision for each database.N)_currentrA   r   r   r   r      r.   r   c                 C   s   t | ||| dS )zP'stamp' the revision table with the given revision; don't run any
    migrationsN)_stamp)r   r#   r6   r   r   r   r   r      s   r   )%click	flask.clir   flask_migrater   r   r   r   r   r    r   r)   r   r,   r   r3   r	   r4   r
   r8   r   r9   r   r:   r   r>   r   r@   r   rB   r   rC   groupr   commandoptionargumentr   r   r   r   <module>   s   



















