관리-도구
편집 파일: schemacompare.cpython-38.pyc
U 0?�f� � @ s� d dl mZ d dlmZ d dlmZ G dd� d�ZG dd� d�ZG dd � d �ZG d d� d�Z G dd � d �Z G dd� d�ZG dd� d�ZdS )� )�zip_longest)�schema)� ClauseListc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�CompareTablec C s || _ d S �N)�table)�selfr � r �K/opt/hc_python/lib/python3.8/site-packages/alembic/testing/schemacompare.py�__init__ s zCompareTable.__init__c C sv | j j|jks| j j|jkr dS t| j j|j�D ]@\}}|d krH|d k sX|d kr^|d k r^ dS t|�|kr0 dS q0dS �NFT)r �namer r �c� CompareColumn)r �other�c1�c2r r r �__eq__ s ��zCompareTable.__eq__c C s | � |� S r �r �r r r r r �__ne__ s zCompareTable.__ne__N��__name__� __module__�__qualname__r r r r r r r r s r c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )r c C s || _ d S r )�column)r r r r r r s zCompareColumn.__init__c C s | j j|jko| j j|jkS r )r r Znullabler r r r r # s �zCompareColumn.__eq__c C s | � |� S r r r r r r r * s zCompareColumn.__ne__Nr r r r r r s r c @ s. e Zd Zddd�Zdd� Zdd� Zdd � Zd S )�CompareIndexFc C s || _ || _d S r )�index� name_only)r r r r r r r / s zCompareIndex.__init__c C sD | j r| jj|jkS tt�| j��tt�|��ko>| jj|jkS d S r )r r r �strr ZCreateIndexZdialect_kwargsr r r r r 3 s ��zCompareIndex.__eq__c C s | � |� S r r r r r r r = s zCompareIndex.__ne__c C sN t | jj� }z|�� j}W n tk r6 t|�}Y nX d| jj� d|� d�S )Nz<CompareIndex �(z)>)r r Zexpressions�compile�string� Exceptionr r )r �exprZexpr_strr r r �__repr__@ s zCompareIndex.__repr__N)F)r r r r r r r% r r r r r . s r c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�CompareCheckConstraintc C s || _ d S r �� constraint�r r( r r r r J s zCompareCheckConstraint.__init__c C sT t |tj�oR| jj|jkoRt| jj�t|j�koR|jj| jjjkoR|jj| jjjkS r )� isinstancer ZCheckConstraintr( r r Zsqltextr r r r r r M s ����zCompareCheckConstraint.__eq__c C s | � |� S r r r r r r r V s zCompareCheckConstraint.__ne__Nr r r r r r&