관리-도구
편집 파일: sqlite.cpython-38.pyc
U 0?�f� � @ sj d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z d d l mZ d d l mZ d dl m Z dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e�r:d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm!Z! d dlm"Z" d dl#m$Z$ ddl%m&Z& G dd� de�Z'eed�d d!d"d#�d$d%��Z(dS )&� )�annotationsN)�Any)�Dict)�Optional)� TYPE_CHECKING)�Union)�cast)�JSON)�schema)�sql� )�alter_table)�format_table_name)�RenameTable)�DefaultImpl� )�util)�compiles)� Inspector)�DDLCompiler)�Cast)� ClauseElement)�Column)� Constraint)�Table)� TypeEngine)�BatchOperationsImplc s� e Zd ZdZdZddd�dd�Zdd �d d�Zdd �dd �Zdddddd�dd�Zddd�dd�Z ddddd�dd�Z d)dddd�� fd d!� Zdd"d#dd$�d%d&�Zd'd(� Z � ZS )*� SQLiteImpl�sqliteFr �bool)�batch_op�returnc C s~ |j D ]r}|d dkrf|d d }t|jtj�rFt|jjtj�rF dS t|jtj j �rx|jjrx dS q|d dkr dS qdS )z�Return True if the given :class:`.BatchOperationsImpl` would need the table to be recreated and copied in order to proceed. Normally, only returns True on SQLite when operations other than add_column are present. r � add_columnr T)Zcreate_indexZ drop_indexFN)�batch� isinstanceZserver_defaultr Z DefaultClause�argr r r Zsqla_compatZComputedZ persisted)�selfr �op�col� r) �@/opt/hc_python/lib/python3.8/site-packages/alembic/ddl/sqlite.py�requires_recreate_in_batch. s$ ����z%SQLiteImpl.requires_recreate_in_batchr )�constc C s, |j d krtd��n|� | �r(t�d� d S )N��No support for ALTER of constraints in SQLite dialect. Please refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.z�Skipping unsupported ALTER for creation of implicit constraint. Please refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.)�_create_rule�NotImplementedErrorr �warn�r&