관리-도구
편집 파일: postgresql.cpython-37.opt-1.pyc
B �M!V� � @ s� d dl Z ddlmZ ddlmZ ddlmZmZmZmZ ddl m Z d dlmZm Z d d lmZmZmZ ejr|d d lmZ nd dlmZ d dlZe�e�ZG dd � d e �Zeed�dd� �ZdS )� N� )�compat)�util� )�compiles�alter_table�format_table_name�RenameTable)�DefaultImpl)�INTEGER�BIGINT)�text�Numeric�Column)�UnaryExpression)�_UnaryExpressionc @ s4 e Zd ZdZdZdd� Zdd� Zdd� Zd d � ZdS )�PostgresqlImpl� postgresqlTc C s( x"|j D ]}|jd k r| �|� qW d S )N)Zconstraints�nameZdrop_constraint)�self�tableZ constraint� r �G/opt/alt/python37/lib/python3.7/site-packages/alembic/ddl/postgresql.py�prep_table_for_batch s z#PostgresqlImpl.prep_table_for_batchc C s� |j r||jjkrdS |}d ||fkr.||kS |jd k rnt|jjtj�rnt� d|�snt|j t�snt�dd|�}| j �d||f � S )NFz^'.+'$z ^u?'?|'?$�'zSELECT %s = %s)Zprimary_keyr Z_autoincrement_columnZserver_default� isinstance�argr Zstring_types�re�match�typer �subZ connectionZscalar)r Zinspector_columnZmetadata_columnZrendered_metadata_defaultZrendered_inspector_defaultZconn_col_defaultr r r �compare_server_default s"