관리-도구
편집 파일: dbmigrate_lib.cpython-311.pyc
� �Cgm � �6 � d dl Z d dlZ d dlmZ d dlmZmZmZ n8# e$ r0Z e dk r ede � �� � ej d� � n� Y dZ [ ndZ [ ww xY we j � e j � e� � d� � Zd� Zd � Zd � Zd� Zd� Zdd�ZdS )� N)�MigrationContext)�config�command�script�__main__z0Alembic Python library is not installed. Error: � zalembic.inic �� � g }t j � | � � }d� |� � � D � � }d}|r,|� |� � |� |� � }|�,|S )Nc �, � i | ]}|j pd |j ��S )�base)� down_revision�revision)�.0�ss ��/builddir/build/BUILDROOT/lve-stats-4.2.10-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/utils/dbmigrator/dbmigrate_lib.py� <dictcomp>z,generate_revisions_chain.<locals>.<dictcomp> s/ � � 0� 0� 0��a�o�/���� 0� 0� 0� r )r �ScriptDirectory�from_config�walk_revisions�append�get)�alembic_cfg�chain_�script_�revision_pairs�curent_revisions r �generate_revisions_chainr s� � � �F��$�0�0��=�=�G�0� 0��,�,�.�.�0� 0� 0�N��O� � >�� � �o�&�&�&�(�,�,�_�=�=�� � >� �Mr c � � | � � � }t j |� � }|� � � }|pdS )Nr )�connectr � configure�get_current_revision)�engine� connection�context�current_revs r �get_database_versionr&