%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyo

�
�M!Vc@s�ddlmZmZddlmZddlmZmZmZddl	m
Z
ddlm	Z	ddlmZd	e
fd
��YZiZdee�fd��YZd
�Zd�Zieej6eej6ZdS(i����(tschemattext(ttypesi(tstring_typest	text_typetwith_metaclass(tsqla_compat(tutili(tbasetImplMetacBseZd�ZRS(cCs9tj||||�}d|kr5|t|d<n|S(Nt__dialect__(ttypet__init__t_impls(tclst	classnametbasestdict_tnewtype((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyRs(t__name__t
__module__R(((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyR	stDefaultImplcBsdeZdZdZeZdZd�Zed��Z	d�Z
d�Zd�Ze
d��Zdd ej�d	�Zdd
�Zdeddddddddd�
Zdd�Zdd
�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zed�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(RS(!s�Provide the entrypoint for major migration operations,
    including database-specific behavioral variances.

    While individual SQL/DDL constructs already provide
    for database-specific implementations, variances here
    allow for entirely different sequences of operations
    to take place for a particular migration, such as
    SQL Server's special 'IDENTITY INSERT' step for
    bulk inserts.

    tdefaultt;cCs�||_||_||_|jdt�|_|jr\tjr\tjd�t|_n||_	i|_
||_|dk	r�||_
n|jr�|js�tjd��q�ndS(Nt
literal_bindss4'literal_binds' flag not supported in SQLAlchemy 0.7s3Can't use literal_binds setting without as_sql mode(tdialectt
connectiontas_sqltgettFalseRRtsqla_08twarnt
output_buffertmemotcontext_optstNonettransactional_ddltCommandError(tselfRRRR$R R"((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyR)s 			
					cCst|jS(N(R
tname(RR((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytget_by_dialect?scCs+|jjt|d��|jj�dS(Ns

(R twriteRtflush(R&R((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt
static_outputCscCstS(s�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(R&tbatch_op((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytrequires_recreate_in_batchGs	cCsdS(s�perform any operations needed on a table before a new
        one is created to replace it in batch mode.

        the PG dialect uses this to drop constraints on the table
        before the new one uses those same names.

        N((R&ttable((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytprep_table_for_batchRscCs|jS(N(R(R&((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytbind[scCs�t|t�rt|�}n|jr�|s3|rBtd��n|jrwt|tj�rwtdit	d6�}ni}|j
t|jd|j
|��jdd�j�|j�n4|j}|r�|j|�}n|j|||�SdS(Ns+Execution arguments not allowed with as_sqltcompile_kwargsRRs	s    (t
isinstanceRRRt	ExceptionRRt
DDLElementtdicttTrueR+RtcompileRtreplacetstriptcommand_terminatorRtexecution_optionstexecute(R&t	constructR;tmultiparamstparamst
compile_kwtconn((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt_exec_s 			cCs|j||�dS(N(RB(R&tsqlR;((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyR<xsc

Cs8|dk	s|dk	r(tjd�n|dk	rk|jtj|||d|d|	d|
d|��n|tk	r�|jtj|||d|d|	d|
d|��n|dk	r�|jtj|||d|d|	d|
d|��n|dk	r4|jtj	|||d|d|	d|
d|��ndS(NsBautoincrement and existing_autoincrement only make sense for MySQLRt
existing_typetexisting_server_defaulttexisting_nullable(
R#RRRBRtColumnNullableRt
ColumnDefaultt
ColumnTypet
ColumnName(
R&t
table_nametcolumn_nametnullabletserver_defaultR'ttype_Rt
autoincrementRDRERFtexisting_autoincrement((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytalter_column{s:



cCs#|jtj||d|��dS(NR(RBRt	AddColumn(R&RKtcolumnR((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt
add_column�scKs#|jtj||d|��dS(NR(RBRt
DropColumn(R&RKRTRtkw((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytdrop_column�scCs;|jdks|j|�r7|jtj|��ndS(N(t_create_ruleR#RBRt
AddConstraint(R&tconst((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytadd_constraint�scCs|jtj|��dS(N(RBRtDropConstraint(R&R[((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytdrop_constraint�scCs#|jtj||d|��dS(NR(RBRtRenameTable(R&told_table_nametnew_table_nameR((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytrename_table�scCs�tjr.|jj||jdtd|�n|jtj|��tjrr|jj	||jdtd|�nx'|j
D]}|jtj|��q|WdS(Nt
checkfirstt_ddl_runner(Rtsqla_07tdispatcht
before_createRRRBRtCreateTabletafter_createtindexestCreateIndex(R&R.tindex((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcreate_table�s	
	
cCs|jtj|��dS(N(RBRt	DropTable(R&R.((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt
drop_table�scCs|jtj|��dS(N(RBRRk(R&Rl((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcreate_index�scCs|jtj|��dS(N(RBRt	DropIndex(R&Rl((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt
drop_index�scs%t|t�std��n)|rGt|dt�rGtd��n|jr�x�|D]D}|j�jdt�jt�fd�|j	�D����qWWnt
�d�s�d�_n|r!|r�|j�jdt�d|�q!x3|D](}|j�jdt�j|��q�WndS(Ns
List expectedisList of dictionaries expectedtinlinec3sU|]K\}}|t|tj�sFtj||d�j|j�n|fVqdS(RON(R2Rt_literal_bindparamtcR(t.0tktv(R.(sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pys	<genexpr>�st_autoincrement_columnR>(
R2tlistt	TypeErrorR5RRBtinsertR6tvaluestitemsthasattrR#Ry(R&R.trowstmultiinserttrow((R.sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytbulk_insert�s 	
"
cCs�|j}|j}|j|j�}|jjdd�t|d�ro|j|j|�}|dk	ro|Sn|j|�r�t	j
|jd�}|o�|||�StSdS(Nt_type_affinitytcompare_against_backend(
Rtdialect_implRt__dict__tpopR#RR�t_compare_type_affinityt_type_comparatorsRR�R6(R&tinspector_columntmetadata_columnt	conn_typet
metadata_typet
metadata_implt
comparisont
comparator((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcompare_type�s			cCs
||kS(N((R&R�R�trendered_metadata_defaulttrendered_inspector_default((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcompare_server_defaultscCsdS(N((R&tconn_uniquestconn_indexestmetadata_unique_constraintstmetadata_indexes((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcorrect_for_autogen_constraints
scs*tjr�jS��fd�}|SdS(Ncs�j�||�S(N(tautogen_column_reflect(R.tcolumn_info(t	inspectorR&(sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytadapts(RRR�(R&R�R�((R�R&sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt_compat_autogen_column_reflects	cCsdS(N((R&tconn_fkstmetadata_fks((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytcorrect_for_autogen_foreignkeysscCsdS(s�A hook that is attached to the 'column_reflect' event for when
        a Table is reflected from the database during the autogenerate
        process.

        Dialects can elect to modify the information gathered here.

        N((R&R�R.R�((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyR�scCsdS(s�A hook called when :meth:`.EnvironmentContext.run_migrations`
        is called.

        Implementations can set up per-migration-run state here.

        N((R&((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytstart_migrations'scCs|jd|j�dS(s�Emit the string ``BEGIN``, or the backend-specific
        equivalent, on the current connection context.

        This is used in offline mode and typically
        via :meth:`.EnvironmentContext.begin_transaction`.

        tBEGINN(R+R:(R&((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt
emit_begin/scCs|jd|j�dS(s�Emit the string ``COMMIT``, or the backend-specific
        equivalent, on the current connection context.

        This is used in offline mode and typically
        via :meth:`.EnvironmentContext.begin_transaction`.

        tCOMMITN(R+R:(R&((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pytemit_commit9sN(()RRt__doc__R
RR$R:RtclassmethodR(R+R-R/tpropertyR0R#Rt
immutabledictRBR<RRRURXR\R^RbRmRoRpRrR6R�R�R�R�R�R�R�R�R�R�(((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyRsV					&			
													
cCs|jdk	o|j|jkS(N(tlengthR#(tt1tt2((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt_string_compareDscCs@|jdk	r!|j|jkp?|jdk	o?|j|jkS(N(t	precisionR#tscale(R�R�((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt_numeric_compareJsN(t
sqlalchemyRRRtsqltypestutil.compatRRRRRtRRR	R
RR�R�tStringtNumericR�(((sA/opt/alt/python27/lib/python2.7/site-packages/alembic/ddl/impl.pyt<module>s�.		



Zerion Mini Shell 1.0