%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyo

�
�M!Vc@s�ddlmZddlmZddlmZddlmZddlmZmZddl	Z	d	e
fd
��YZdefd��YZej
d
�ej
d
d�defd��Y��Zej
d�ej
dd�defd��Y��Zej
d�ej
dd�defd��Y��Zej
d�ej
dd�defd��Y��Zej
d�ej
dd�defd ��Y��Zej
d!�ej
d!d"�d#efd$��Y��Zej
d%�ej
d%d&�d'efd(��Y��Zej
d)�d*efd+��Y�Zej
d,�d-efd.��Y�Zd/efd0��YZej
d1�d2efd3��Y�Zej
d4�ej
d4d5�d6efd7��Y��Zej
d8�ej
d8d9�d:efd;��Y��Zej
d<�ej
d<d=�d>efd?��Y��Zej
d@�dAefdB��Y�Zej
dC�dDefdE��Y�ZdFefdG��YZdHefdI��YZdJefdK��YZ dLefdM��YZ!dNefdO��YZ"dS(Pi(tutil(tsqla_compati(t	schemaobji����(tNULLTYPE(t
OperationstBatchOperationsNtMigrateOperationcBs eZdZejd��ZRS(sbase class for migration command and organization objects.

    This system is part of the operation extensibility API.

    .. versionadded:: 0.8.0

    .. seealso::

        :ref:`operation_objects`

        :ref:`operation_plugins`

        :ref:`customizing_revision`

    cCsiS(s�A dictionary that may be used to store arbitrary information
        along with this :class:`.MigrateOperation` object.

        ((tself((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytinfos(t__name__t
__module__t__doc__Rtmemoized_propertyR(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR	stAddConstraintOpcBs>eZdZed��Zed��Zd�Zd�ZRS(s&Represent an add constraint operation.cCs
t��dS(N(tNotImplementedError(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytconstraint_type&scCsIitjd6tjd6tjd6tjd6tjd6}||j|�S(Ntunique_constrainttforeign_key_constrainttprimary_key_constrainttcheck_constrainttcolumn_check_constraint(tCreateUniqueConstraintOptfrom_constrainttCreateForeignKeyOptCreatePrimaryKeyOptCreateCheckConstraintOpt__visit_name__(tclst
constrainttfuncs((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR*s




cCstj|j��S(N(tDropConstraintOpRt
to_constraint(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytreverse5scCsd|j�fS(Ntadd_constraint(R(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyt
to_diff_tuple8s(	R	R
RtpropertyRtclassmethodRR R"(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR
#s
	tdrop_constrainttbatch_drop_constraintRcBs�eZdZdddd�Zd�Zd�Zed��Zd�Z	ee
jd
dg�ddd
���Zedd��Z
RS(s&Represent a drop constraint operation.cCs1||_||_||_||_||_dS(N(tconstraint_namet
table_nameRtschemat_orig_constraint(RR'R(ttype_R)R*((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyt__init__As
				cCs.|jdkrtd��ntj|j�S(Ns?operation is not reversible; original constraint is not present(R*tNonet
ValueErrorR
R(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR KscCs3|jdkrd|j�fSd|j�fSdS(Nt
foreignkeyt	remove_fktremove_constraint(RR(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"Rsc	Csgidd6dd6dd6dd6dd	6}tj|�}||j|jd
|jd||jd|�S(
NtuniqueRR/RtprimaryRtcheckRRR)R+R*(Rt_table_for_constrainttnameR)R(RRttypestconstraint_table((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRXs
		
cCs&|jdk	r|jStd��dS(NsAconstraint cannot be produced; original constraint is not present(R*R-R.(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRksttypeR+R6R'cCs(|||d|d|�}|j|�S(sDrop a constraint of the given name, typically via DROP CONSTRAINT.

        :param constraint_name: name of the constraint.
        :param table_name: table name.
        :param ``type_``: optional, required on MySQL.  can be
         'foreignkey', 'primary', 'unique', or 'check'.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name

        R+R)(tinvoke(Rt
operationsR'R(R+R)top((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR%sscCs4|||jjd|d|jj�}|j|�S(s�Issue a "drop constraint" instruction using the
        current batch migration context.

        The batch form of this call omits the ``table_name`` and ``schema``
        arguments from the call.

        .. seealso::

            :meth:`.Operations.drop_constraint`

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name

        R+R)(timplR(R)R:(RR;R'R+R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR&�sN(stypestype_(snamesconstraint_name(R	R
RR-R,R R"R$RRRt_with_legacy_namesR%R&(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR<s				tcreate_primary_keytbatch_create_primary_keyRcBsteZdZdZddd�Zed��Zdd�Zee	j
dd
g�dd	���Zed
��ZRS(s)Represent a create primary key operation.t
primarykeycKs:||_||_||_||_||_||_dS(N(R'R(tcolumnsR)R*tkw(RR'R(RBR)R*RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s					cCs7tj|�}||j|j|jd|jd|�S(NR)R*(RR5R6RBR)(RRR8((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s		cCsJ|jdk	r|jStj|�}|j|j|j|jd|j�S(NR)(	R*R-Rt
SchemaObjectsRR'R(RBR)(Rtmigration_contextt
schema_obj((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�sR6R'tcolsRBcCs"|||||�}|j|�S(s�Issue a "create primary key" instruction using the current
        migration context.

        e.g.::

            from alembic import op
            op.create_primary_key(
                        "pk_my_table", "my_table",
                        ["id", "version"]
                    )

        This internally generates a :class:`~sqlalchemy.schema.Table` object
        containing the necessary columns, then generates a new
        :class:`~sqlalchemy.schema.PrimaryKeyConstraint`
        object which it then associates with the
        :class:`~sqlalchemy.schema.Table`.
        Any event listeners associated with this action will be fired
        off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
        construct is ultimately used to generate the ALTER statement.

        :param name: Name of the primary key constraint.  The name is necessary
         so that an ALTER statement can be emitted.  For setups that
         use an automated naming scheme such as that described at
         :ref:`sqla:constraint_naming_conventions`
         ``name`` here can be ``None``, as the event listener will
         apply the name to the constraint object when it is associated
         with the table.
        :param table_name: String name of the target table.
        :param columns: a list of string column names to be applied to the
         primary key constraint.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name
           * cols -> columns

        (R:(RR;R'R(RBR)R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR?�s5cCs1|||jj|d|jj�}|j|�S(sIssue a "create primary key" instruction using the
        current batch migration context.

        The batch form of this call omits the ``table_name`` and ``schema``
        arguments from the call.

        .. seealso::

            :meth:`.Operations.create_primary_key`

        R)(R=R(R)R:(RR;R'RBR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR@s
N(snamesconstraint_name(RGscolumns(
R	R
RRR-R,R$RRRR>R?R@(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s		1tcreate_unique_constrainttbatch_create_unique_constraintRcBs�eZdZdZd
d
d�Zed��Zd
d�Zee	j
dddg�d
d���Zee	j
dg�d���ZRS(s/Represent a create unique constraint operation.R2cKs:||_||_||_||_||_||_dS(N(R'R(RBR)R*RC(RR'R(RBR)R*RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,'s					c	Cs�tj|�}i}|jr.|j|d<n|jrG|j|d<n||j|jg|jD]}|j^q`d|jd||�S(Nt
deferrablet	initiallyR)R*(RR5RJRKR6RBR)(RRR8RCtc((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR1s			cCsP|jdk	r|jStj|�}|j|j|j|jd|j|j	�S(NR)(
R*R-RRDRR'R(RBR)RC(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRDsR6R'tsourceR(t
local_colsRBcKs(||||d||�}|j|�S(sGIssue a "create unique constraint" instruction using the
        current migration context.

        e.g.::

            from alembic import op
            op.create_unique_constraint("uq_user_name", "user", ["name"])

        This internally generates a :class:`~sqlalchemy.schema.Table` object
        containing the necessary columns, then generates a new
        :class:`~sqlalchemy.schema.UniqueConstraint`
        object which it then associates with the
        :class:`~sqlalchemy.schema.Table`.
        Any event listeners associated with this action will be fired
        off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
        construct is ultimately used to generate the ALTER statement.

        :param name: Name of the unique constraint.  The name is necessary
         so that an ALTER statement can be emitted.  For setups that
         use an automated naming scheme such as that described at
         :ref:`sqla:constraint_naming_conventions`,
         ``name`` here can be ``None``, as the event listener will
         apply the name to the constraint object when it is associated
         with the table.
        :param table_name: String name of the source table.
        :param columns: a list of string column names in the
         source table.
        :param deferrable: optional bool. If set, emit DEFERRABLE or
         NOT DEFERRABLE when issuing DDL for this constraint.
        :param initially: optional string. If set, emit INITIALLY <value>
         when issuing DDL for this constraint.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name
           * source -> table_name
           * local_cols -> columns

        R)(R:(RR;R'R(RBR)RCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRHMs9cKs8|jj|d<|||jj||�}|j|�S(s�Issue a "create unique constraint" instruction using the
        current batch migration context.

        The batch form of this call omits the ``source`` and ``schema``
        arguments from the call.

        .. seealso::

            :meth:`.Operations.create_unique_constraint`

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name

        R)(R=R)R(R:(RR;R'RBRCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRI�s
	N(snamesconstraint_name(ssources
table_name(s
local_colsscolumns(snamesconstraint_name(
R	R
RRR-R,R$RRRR>RHRI(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRs		7tcreate_foreign_keytbatch_create_foreign_keyRc
Bs�eZdZdZdd�Zd�Zed��Zdd�Z	ee
jdddg�dddddddd���Zee
jddg�ddddddd
���Z
RS(s4Represent a create foreign key constraint operation.R/cKsC||_||_||_||_||_||_||_dS(N(R'tsource_tabletreferent_tableRNtremote_colsR*RC(RR'RQRRRNRSR*RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s						cCsd|j�fS(Ntadd_fk(R(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"�sc

Cs�i}|jr|j|d<n|jr8|j|d<n|jrQ|j|d<n|jrj|j|d<n|jr�|j|d<ntj|�\
}}}}}}}	}
}}||d<||d<||j||||d||�S(	NtonupdatetondeleteRKRJt	use_altert
source_schematreferent_schemaR*(RURVRKRJRWRt_fk_specR6(
RRRCRXRQtsource_columnst
target_schemattarget_tablettarget_columnsRURVRJRK((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s,					-

cCsS|jdk	r|jStj|�}|j|j|j|j|j|j	|j
�S(N(R*R-RRDRR'RQRRRNRSRC(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�sR6R'RMRQtreferentRRcKsR||||||d|d|d|	d|d|
d|
d||�}|j|�S(sW	Issue a "create foreign key" instruction using the
        current migration context.

        e.g.::

            from alembic import op
            op.create_foreign_key(
                        "fk_user_address", "address",
                        "user", ["user_id"], ["id"])

        This internally generates a :class:`~sqlalchemy.schema.Table` object
        containing the necessary columns, then generates a new
        :class:`~sqlalchemy.schema.ForeignKeyConstraint`
        object which it then associates with the
        :class:`~sqlalchemy.schema.Table`.
        Any event listeners associated with this action will be fired
        off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
        construct is ultimately used to generate the ALTER statement.

        :param name: Name of the foreign key constraint.  The name is necessary
         so that an ALTER statement can be emitted.  For setups that
         use an automated naming scheme such as that described at
         :ref:`sqla:constraint_naming_conventions`,
         ``name`` here can be ``None``, as the event listener will
         apply the name to the constraint object when it is associated
         with the table.
        :param source_table: String name of the source table.
        :param referent_table: String name of the destination table.
        :param local_cols: a list of string column names in the
         source table.
        :param remote_cols: a list of string column names in the
         remote table.
        :param onupdate: Optional string. If set, emit ON UPDATE <value> when
         issuing DDL for this constraint. Typical values include CASCADE,
         DELETE and RESTRICT.
        :param ondelete: Optional string. If set, emit ON DELETE <value> when
         issuing DDL for this constraint. Typical values include CASCADE,
         DELETE and RESTRICT.
        :param deferrable: optional bool. If set, emit DEFERRABLE or NOT
         DEFERRABLE when issuing DDL for this constraint.
        :param source_schema: Optional schema name of the source table.
        :param referent_schema: Optional schema name of the destination table.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name
           * source -> source_table
           * referent -> referent_table

        RURVRJRXRYRKtmatch(R:(RR;R'RQRRRNRSRURVRJRKR`RXRYt
dialect_kwR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRO�s@			cKs^|||jj|||d|d|d|	d|jjd|d|
d||�}
|j|
�S(s�Issue a "create foreign key" instruction using the
        current batch migration context.

        The batch form of this call omits the ``source`` and ``source_schema``
        arguments from the call.

        e.g.::

            with batch_alter_table("address") as batch_op:
                batch_op.create_foreign_key(
                            "fk_user_address",
                            "user", ["user_id"], ["id"])

        .. seealso::

            :meth:`.Operations.create_foreign_key`

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name
           * referent -> referent_table

        RURVRJRXRYRKR`(R=R(R)R:(RR;R'RRRNRSRYRURVRJRKR`RaR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRP6s$			N(snamesconstraint_name(ssourcessource_table(R_sreferent_table(snamesconstraint_name(R_sreferent_table(R	R
RRR-R,R"R$RRRR>RORP(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s*		!
		C	tcreate_check_constrainttbatch_create_check_constraintRcBs�eZdZdZddd�Zed��Zdd�Zee	j
dd
g�dd	���Zee	j
dg�d
���ZRS(s.Represent a create check constraint operation.R4cKs:||_||_||_||_||_||_dS(N(R'R(t	conditionR)R*RC(RR'R(RdR)R*RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,ps					cCs7tj|�}||j|j|jd|jd|�S(NR)R*(RR5R6tsqltextR)(RRR8((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRzs		cCsP|jdk	r|jStj|�}|j|j|j|jd|j|j	�S(NR)(
R*R-RRDRR'R(RdR)RC(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�sR6R'RMR(cKs(||||d||�}|j|�S(s2Issue a "create check constraint" instruction using the
        current migration context.

        e.g.::

            from alembic import op
            from sqlalchemy.sql import column, func

            op.create_check_constraint(
                "ck_user_name_len",
                "user",
                func.len(column('name')) > 5
            )

        CHECK constraints are usually against a SQL expression, so ad-hoc
        table metadata is usually needed.   The function will convert the given
        arguments into a :class:`sqlalchemy.schema.CheckConstraint` bound
        to an anonymous table in order to emit the CREATE statement.

        :param name: Name of the check constraint.  The name is necessary
         so that an ALTER statement can be emitted.  For setups that
         use an automated naming scheme such as that described at
         :ref:`sqla:constraint_naming_conventions`,
         ``name`` here can be ``None``, as the event listener will
         apply the name to the constraint object when it is associated
         with the table.
        :param table_name: String name of the source table.
        :param condition: SQL expression that's the condition of the
         constraint. Can be a string or SQLAlchemy expression language
         structure.
        :param deferrable: optional bool. If set, emit DEFERRABLE or
         NOT DEFERRABLE when issuing DDL for this constraint.
        :param initially: optional string. If set, emit INITIALLY <value>
         when issuing DDL for this constraint.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name
           * source -> table_name

        R)(R:(RR;R'R(RdR)RCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRb�s:cKs4|||jj|d|jj|�}|j|�S(s�Issue a "create check constraint" instruction using the
        current batch migration context.

        The batch form of this call omits the ``source`` and ``schema``
        arguments from the call.

        .. seealso::

            :meth:`.Operations.create_check_constraint`

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> constraint_name

        R)(R=R(R)R:(RR;R'RdRCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRc�sN(snamesconstraint_name(ssources
table_name(snamesconstraint_name(
R	R
RRR-R,R$RRRR>RbRc(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRhs	5tcreate_indextbatch_create_indext
CreateIndexOpcBs�eZdZd
ed
d�Zd�Zd�Zed��Z	d
d�Z
eejdg�d
ed���Z
ed	��ZRS(s#Represent a create index operation.cKsC||_||_||_||_||_||_||_dS(N(t
index_nameR(RBR)R2RCt_orig_index(RRiR(RBR)R2RjRC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s						cCstj|j��S(N(tDropIndexOpt
from_indextto_index(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR �scCsd|j�fS(Nt	add_index(Rm(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"�scCsC||j|jjtj|�d|jjd|jd||j�S(NR)R2Rj(R6ttableRt_get_index_expressionsR)R2tkwargs(Rtindex((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRl�s		c	CsS|jr|jStj|�}|j|j|j|jd|jd|j|j	�S(NR)R2(
RjRRDRrRiR(RBR)R2RC(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRms	R6Ric		Ks.||||d|d||�}|j|�S(sC	Issue a "create index" instruction using the current
        migration context.

        e.g.::

            from alembic import op
            op.create_index('ik_test', 't1', ['foo', 'bar'])

        Functional indexes can be produced by using the
        :func:`sqlalchemy.sql.expression.text` construct::

            from alembic import op
            from sqlalchemy import text
            op.create_index('ik_test', 't1', [text('lower(foo)')])

        .. versionadded:: 0.6.7 support for making use of the
           :func:`~sqlalchemy.sql.expression.text` construct in
           conjunction with
           :meth:`.Operations.create_index` in
           order to produce functional expressions within CREATE INDEX.

        :param index_name: name of the index.
        :param table_name: name of the owning table.
        :param columns: a list consisting of string column names and/or
         :func:`~sqlalchemy.sql.expression.text` constructs.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        :param unique: If True, create a unique index.

        :param quote:
            Force quoting of this column's name on or off, corresponding
            to ``True`` or ``False``. When left at its default
            of ``None``, the column identifier will be quoted according to
            whether the name is case sensitive (identifiers with at least one
            upper case character are treated as case sensitive), or if it's a
            reserved word. This flag is only needed to force quoting of a
            reserved word which is not known by the SQLAlchemy dialect.

        :param \**kw: Additional keyword arguments not mentioned above are
            dialect specific, and passed in the form
            ``<dialectname>_<argname>``.
            See the documentation regarding an individual dialect at
            :ref:`dialect_toplevel` for detail on documented arguments.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> index_name

        R)R2(R:(	RR;RiR(RBR)R2RCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRfs>cKs4|||jj|d|jj|�}|j|�S(s�Issue a "create index" instruction using the
        current batch migration context.

        .. seealso::

            :meth:`.Operations.create_index`

        R)(R=R(R)R:(RR;RiRBRCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRgSsN(snames
index_name(R	R
RR-tFalseR,R R"R$RlRmRR>RfRg(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRh�s			?t
drop_indextbatch_drop_indexRkcBs�eZdZdddd�Zd�Zd�Zed��Zdd�Z	ee
jd
dg�ddd
���Zee
jdg�d���Z
RS(s!Represent a drop index operation.cCs(||_||_||_||_dS(N(RiR(R)Rj(RRiR(R)Rj((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,js			cCsd|j�fS(Ntremove_index(Rm(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"qscCs.|jdkrtd��ntj|j�S(Ns:operation is not reversible; original index is not present(RjR-R.RhRl(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR tscCs(||j|jjd|jjd|�S(NR)Rj(R6RoR)(RRr((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRl{s
cCsJ|jdk	r|jStj|�}|j|j|jdgd|j�S(NtxR)(RjR-RRDRrRiR(R)(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRm�s
R6Rit	tablenameR(cCs%||d|d|�}|j|�S(s&Issue a "drop index" instruction using the current
        migration context.

        e.g.::

            drop_index("accounts")

        :param index_name: name of the index.
        :param table_name: name of the owning table.  Some
         backends such as Microsoft SQL Server require this.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> index_name

        R(R)(R:(RR;RiR(R)R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRt�scKs1||d|jjd|jj�}|j|�S(s)Issue a "drop index" instruction using the
        current batch migration context.

        .. seealso::

            :meth:`.Operations.drop_index`

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> index_name

        R(R)(R=R(R)R:(RR;RiRCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRu�sN(snames
index_name(Rxs
table_name(snames
index_name(R	R
RR-R,R"R R$RlRmRR>RtRu(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRkes				tcreate_tablet
CreateTableOpcBskeZdZd	d	d�Zd�Zd�Zed��Zd	d�Z	ee
jd
g�d���ZRS(s#Represent a create table operation.cKs1||_||_||_||_||_dS(N(R(RBR)RCt_orig_table(RR(RBR)R{RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s
				cCstj|j��S(N(tDropTableOpt
from_tabletto_table(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR �scCsd|j�fS(Nt	add_table(R~(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"�scCs;||jt|j�t|j�d|jd||j�S(NR)R{(R6tlistRLtconstraintsR)Rq(RRo((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR}�s	cCsJ|jdk	r|jStj|�}|j|jd|j|j|j�S(NR)(	R{R-RRDRoR(R)RBRC(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR~�s
R6R(cOs||||�}|j|�S(s�
Issue a "create table" instruction using the current migration
        context.

        This directive receives an argument list similar to that of the
        traditional :class:`sqlalchemy.schema.Table` construct, but without the
        metadata::

            from sqlalchemy import INTEGER, VARCHAR, NVARCHAR, Column
            from alembic import op

            op.create_table(
                'account',
                Column('id', INTEGER, primary_key=True),
                Column('name', VARCHAR(50), nullable=False),
                Column('description', NVARCHAR(200)),
                Column('timestamp', TIMESTAMP, server_default=func.now())
            )

        Note that :meth:`.create_table` accepts
        :class:`~sqlalchemy.schema.Column`
        constructs directly from the SQLAlchemy library.  In particular,
        default values to be created on the database side are
        specified using the ``server_default`` parameter, and not
        ``default`` which only specifies Python-side defaults::

            from alembic import op
            from sqlalchemy import Column, TIMESTAMP, func

            # specify "DEFAULT NOW" along with the "timestamp" column
            op.create_table('account',
                Column('id', INTEGER, primary_key=True),
                Column('timestamp', TIMESTAMP, server_default=func.now())
            )

        The function also returns a newly created
        :class:`~sqlalchemy.schema.Table` object, corresponding to the table
        specification given, which is suitable for
        immediate SQL operations, in particular
        :meth:`.Operations.bulk_insert`::

            from sqlalchemy import INTEGER, VARCHAR, NVARCHAR, Column
            from alembic import op

            account_table = op.create_table(
                'account',
                Column('id', INTEGER, primary_key=True),
                Column('name', VARCHAR(50), nullable=False),
                Column('description', NVARCHAR(200)),
                Column('timestamp', TIMESTAMP, server_default=func.now())
            )

            op.bulk_insert(
                account_table,
                [
                    {"name": "A1", "description": "account 1"},
                    {"name": "A2", "description": "account 2"},
                ]
            )

        .. versionadded:: 0.7.0

        :param table_name: Name of the table
        :param \*columns: collection of :class:`~sqlalchemy.schema.Column`
         objects within
         the table, as well as optional :class:`~sqlalchemy.schema.Constraint`
         objects
         and :class:`~.sqlalchemy.schema.Index` objects.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.
        :param \**kw: Other keyword arguments are passed to the underlying
         :class:`sqlalchemy.schema.Table` object created for the command.

        :return: the :class:`~sqlalchemy.schema.Table` object corresponding
         to the parameters given.

         .. versionadded:: 0.7.0 - the :class:`~sqlalchemy.schema.Table`
            object is returned.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> table_name

        (R:(RR;R(RBRCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRy�s\N(snames
table_name(
R	R
RR-R,R R"R$R}R~RR>Ry(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyRz�s		
	t
drop_tableR|cBsqeZdZd	d	d	d�Zd�Zd�Zed��Zd	d�Z	ee
jd
g�d	d���ZRS(s!Represent a drop table operation.cCs.||_||_|pi|_||_dS(N(R(R)ttable_kwR{(RR(R)R�R{((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,Qs		cCsd|j�fS(Ntremove_table(R~(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"XscCs.|jdkrtd��ntj|j�S(Ns:operation is not reversible; original table is not present(R{R-R.RzR}(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR [scCs||jd|jd|�S(NR)R{(R6R)(RRo((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR}bscCsD|jdk	r|jStj|�}|j|jd|j|j�S(NR)(R{R-RRDRoR(R)R�(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR~fs	R6R(cKs)||d|d|�}|j|�dS(sDIssue a "drop table" instruction using the current
        migration context.


        e.g.::

            drop_table("accounts")

        :param table_name: Name of the table
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        :param \**kw: Other keyword arguments are passed to the underlying
         :class:`sqlalchemy.schema.Table` object created for the command.

        .. versionchanged:: 0.8.0 The following positional argument names
           have been changed:

           * name -> table_name

        R)R�N(R:(RR;R(R)RCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�osN(snames
table_name(
R	R
RR-R,R"R R$R}R~RR>R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR|Ms			tAlterTableOpcBseZdZdd�ZRS(s#Represent an alter table operation.cCs||_||_dS(N(R(R)(RR(R)((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s	N(R	R
RR-R,(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��strename_tablet
RenameTableOpcBs,eZdZdd�Zedd��ZRS(s#Represent a rename table operation.cCs)tt|�j|d|�||_dS(NR)(tsuperR�R,tnew_table_name(Rtold_table_nameR�R)((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�scCs"|||d|�}|j|�S(s�Emit an ALTER TABLE to rename a table.

        :param old_table_name: old name.
        :param new_table_name: new name.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        R)(R:(RR;R�R�R)R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��sN(R	R
RR-R,R$R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��stalter_columntbatch_alter_columnt
AlterColumnOpcBs�eZdZd	d	ed	d	ed	d	d�Zd�Zd�Zd�Ze	e
jd
g�d	ed	d	d	ed	d	d���Ze	d	ed	d	d	ed	d��Z
RS(s$Represent an alter column operation.cKsqtt|�j|d|�||_||_||_||_||_||_|	|_	|
|_
||_dS(NR)(R�R�R,tcolumn_namet
existing_typetexisting_server_defaulttexisting_nullabletmodify_nullabletmodify_server_defaulttmodify_nametmodify_typeRC(RR(R�R)R�R�R�R�R�R�R�RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s								cCsg}|j|j|j}}}|jdk	rq|jd|||i|jd6|jd6|j|jf�n|j	dk	r�|jd|||i|jd6|jd6|j|j	f�n|j
tk	r
|jd|||i|jd6|jd6|j|j
f�n|S(NR�R�R�R�R�tmodify_default(R)R(R�R�R-tappendR�R�R�R�R�Rs(Rtcol_diffR)ttnametcname((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"�s6





cCsf|jdk	p*|jtk	p*|jdk	}|r7tSx(|jD]}|jd�rAtSqAWtSdS(Ntmodify_(R�R-R�RsR�tTrueRCt
startswith(Rthc1RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pythas_changes�scCs@|jj�}|j|d<|j|d<|j|d<|jdk	rU|j|d<n|jdk	rt|j|d<n|jt	k	r�|j|d<nt
d�g|D]}tjd|�^q�D��}xS|D]K}d	||kr�|d
|}|d	||d
|<||d	|<q�q�W|j
|j|jd|j|�S(NR�R�R�R�R�R�css$|]}|r|jd�VqdS(iN(tgroup(t.0tm((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pys	<genexpr>ss^(?:existing_|modify_)(.+)$s	modify_%ssexisting_%sR)(RCtcopyR�R�R�R�R-R�R�RstsettreR`t	__class__R(R�R)(RRCtktall_keystswap((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR s*


	)
R6tnew_column_namecKsO|||d|d|d|	d|
d|d|d|d||�}
|j|
�S(	sXIssue an "alter column" instruction using the
        current migration context.

        Generally, only that aspect of the column which
        is being changed, i.e. name, type, nullability,
        default, needs to be specified.  Multiple changes
        can also be specified at once and the backend should
        "do the right thing", emitting each change either
        separately or together as the backend allows.

        MySQL has special requirements here, since MySQL
        cannot ALTER a column without a full specification.
        When producing MySQL-compatible migration files,
        it is recommended that the ``existing_type``,
        ``existing_server_default``, and ``existing_nullable``
        parameters be present, if not being altered.

        Type changes which are against the SQLAlchemy
        "schema" types :class:`~sqlalchemy.types.Boolean`
        and  :class:`~sqlalchemy.types.Enum` may also
        add or drop constraints which accompany those
        types on backends that don't support them natively.
        The ``existing_server_default`` argument is
        used in this case as well to remove a previous
        constraint.

        :param table_name: string name of the target table.
        :param column_name: string name of the target column,
         as it exists before the operation begins.
        :param nullable: Optional; specify ``True`` or ``False``
         to alter the column's nullability.
        :param server_default: Optional; specify a string
         SQL expression, :func:`~sqlalchemy.sql.expression.text`,
         or :class:`~sqlalchemy.schema.DefaultClause` to indicate
         an alteration to the column's default value.
         Set to ``None`` to have the default removed.
        :param new_column_name: Optional; specify a string name here to
         indicate the new name within a column rename operation.
        :param ``type_``: Optional; a :class:`~sqlalchemy.types.TypeEngine`
         type object to specify a change to the column's type.
         For SQLAlchemy types that also indicate a constraint (i.e.
         :class:`~sqlalchemy.types.Boolean`, :class:`~sqlalchemy.types.Enum`),
         the constraint is also generated.
        :param autoincrement: set the ``AUTO_INCREMENT`` flag of the column;
         currently understood by the MySQL dialect.
        :param existing_type: Optional; a
         :class:`~sqlalchemy.types.TypeEngine`
         type object to specify the previous type.   This
         is required for all MySQL column alter operations that
         don't otherwise specify a new type, as well as for
         when nullability is being changed on a SQL Server
         column.  It is also used if the type is a so-called
         SQLlchemy "schema" type which may define a constraint (i.e.
         :class:`~sqlalchemy.types.Boolean`,
         :class:`~sqlalchemy.types.Enum`),
         so that the constraint can be dropped.
        :param existing_server_default: Optional; The existing
         default value of the column.   Required on MySQL if
         an existing default is not being changed; else MySQL
         removes the default.
        :param existing_nullable: Optional; the existing nullability
         of the column.  Required on MySQL if the existing nullability
         is not being changed; else MySQL sets this to NULL.
        :param existing_autoincrement: Optional; the existing autoincrement
         of the column.  Used for MySQL's system of altering a column
         that specifies ``AUTO_INCREMENT``.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        R)R�R�R�R�R�R�R�(R:(RR;R(R�tnullabletserver_defaultR�R+R�R�R�R)RCtalt((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�!sY	c
Ks[||jj|d|jjd|d|d|	d|d|d|d||
�}|j|�S(	s�Issue an "alter column" instruction using the current
        batch migration context.

        .. seealso::

            :meth:`.Operations.add_column`

        R)R�R�R�R�R�R�R�(R=R(R)R:(RR;R�R�R�R�R+R�R�R�RCR�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s	N(snamesnew_column_name(R	R
RR-RsR,R"R�R R$RR>R�R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s<	'		\t
add_columntbatch_add_columntAddColumnOpcBsteZdZd	d�Zd�Zd�Zd�Zed��Z	ed��Z
ed	d��Zed��ZRS(
s"Represent an add column operation.cCs)tt|�j|d|�||_dS(NR)(R�R�R,tcolumn(RR(R�R)((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�scCstj|j|j|j�S(N(tDropColumnOptfrom_column_and_tablenameR)R(R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR �scCsd|j|j|jfS(NR�(R)R(R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"�scCs|jS(N(R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyt	to_column�scCs||jj|d|jj�S(NR)(RoR6R)(Rtcol((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytfrom_column�scCs|||d|�S(NR)((RR)R�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��scCs"|||d|�}|j|�S(s�Issue an "add column" instruction using the current
        migration context.

        e.g.::

            from alembic import op
            from sqlalchemy import Column, String

            op.add_column('organization',
                Column('name', String())
            )

        The provided :class:`~sqlalchemy.schema.Column` object can also
        specify a :class:`~sqlalchemy.schema.ForeignKey`, referencing
        a remote table name.  Alembic will automatically generate a stub
        "referenced" table and emit a second ALTER statement in order
        to add the constraint separately::

            from alembic import op
            from sqlalchemy import Column, INTEGER, ForeignKey

            op.add_column('organization',
                Column('account_id', INTEGER, ForeignKey('accounts.id'))
            )

        Note that this statement uses the :class:`~sqlalchemy.schema.Column`
        construct as is from the SQLAlchemy library.  In particular,
        default values to be created on the database side are
        specified using the ``server_default`` parameter, and not
        ``default`` which only specifies Python-side defaults::

            from alembic import op
            from sqlalchemy import Column, TIMESTAMP, func

            # specify "DEFAULT NOW" along with the column add
            op.add_column('account',
                Column('timestamp', TIMESTAMP, server_default=func.now())
            )

        :param table_name: String name of the parent table.
        :param column: a :class:`sqlalchemy.schema.Column` object
         representing the new column.
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.


        R)(R:(RR;R(R�R)R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s7cCs.||jj|d|jj�}|j|�S(s�Issue an "add column" instruction using the current
        batch migration context.

        .. seealso::

            :meth:`.Operations.add_column`

        R)(R=R(R)R:(RR;R�R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s
N(
R	R
RR-R,R R"R�R$R�R�R�R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s			9tdrop_columntbatch_drop_columnR�cBskeZdZddd�Zd�Zd�Zed��Zdd�Z	edd��Z
ed��ZRS(	s"Represent a drop column operation.cKs;tt|�j|d|�||_||_||_dS(NR)(R�R�R,R�RCt_orig_column(RR(R�R)R�RC((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,s		cCsd|j|j|j�fS(Nt
remove_column(R)R(R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR"scCs:|jdkrtd��ntj|j|j|j�S(Ns;operation is not reversible; original column is not present(R�R-R.R�R�R)R((R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR #s
cCs|||jd|d|�S(NR)R�(R6(RR)R�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�,scCs8|jdk	r|jStj|�}|j|jt�S(N(R�R-RRDR�R�R(RRERF((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�0scKs%|||d||�}|j|�S(sIssue a "drop column" instruction using the current
        migration context.

        e.g.::

            drop_column('organization', 'account_id')

        :param table_name: name of table
        :param column_name: name of column
        :param schema: Optional schema name to operate within.  To control
         quoting of the schema outside of the default behavior, use
         the SQLAlchemy construct
         :class:`~sqlalchemy.sql.elements.quoted_name`.

         .. versionadded:: 0.7.0 'schema' can now accept a
            :class:`~sqlalchemy.sql.elements.quoted_name` construct.

        :param mssql_drop_check: Optional boolean.  When ``True``, on
         Microsoft SQL Server only, first
         drop the CHECK constraint on the column using a
         SQL-script-compatible
         block that selects into a @variable from sys.check_constraints,
         then exec's a separate DROP CONSTRAINT for that constraint.
        :param mssql_drop_default: Optional boolean.  When ``True``, on
         Microsoft SQL Server only, first
         drop the DEFAULT constraint on the column using a
         SQL-script-compatible
         block that selects into a @variable from sys.default_constraints,
         then exec's a separate DROP CONSTRAINT for that default.
        :param mssql_drop_foreign_key: Optional boolean.  When ``True``, on
         Microsoft SQL Server only, first
         drop a single FOREIGN KEY constraint on the column using a
         SQL-script-compatible
         block that selects into a @variable from
         sys.foreign_keys/sys.foreign_key_columns,
         then exec's a separate DROP CONSTRAINT for that default.  Only
         works if the column has exactly one FK constraint which refers to
         it, at the moment.

         .. versionadded:: 0.6.2

        R)(R:(RR;R(R�R)RCR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�6s.cCs.||jj|d|jj�}|j|�S(s�Issue a "drop column" instruction using the current
        batch migration context.

        .. seealso::

            :meth:`.Operations.drop_column`

        R)(R=R(R)R:(RR;R�R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�gs
N(R	R
RR-R,R"R R$R�R�R�R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�s			/tbulk_inserttBulkInsertOpcBs,eZdZed�Zeed��ZRS(s"Represent a bulk insert operation.cCs||_||_||_dS(N(Rotrowstmultiinsert(RRoR�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,{s		cCs&|||d|�}|j|�dS(s�
Issue a "bulk insert" operation using the current
        migration context.

        This provides a means of representing an INSERT of multiple rows
        which works equally well in the context of executing on a live
        connection as well as that of generating a SQL script.   In the
        case of a SQL script, the values are rendered inline into the
        statement.

        e.g.::

            from alembic import op
            from datetime import date
            from sqlalchemy.sql import table, column
            from sqlalchemy import String, Integer, Date

            # Create an ad-hoc table to use for the insert statement.
            accounts_table = table('account',
                column('id', Integer),
                column('name', String),
                column('create_date', Date)
            )

            op.bulk_insert(accounts_table,
                [
                    {'id':1, 'name':'John Smith',
                            'create_date':date(2010, 10, 5)},
                    {'id':2, 'name':'Ed Williams',
                            'create_date':date(2007, 5, 27)},
                    {'id':3, 'name':'Wendy Jones',
                            'create_date':date(2008, 8, 15)},
                ]
            )

        When using --sql mode, some datatypes may not render inline
        automatically, such as dates and other special types.   When this
        issue is present, :meth:`.Operations.inline_literal` may be used::

            op.bulk_insert(accounts_table,
                [
                    {'id':1, 'name':'John Smith',
                            'create_date':op.inline_literal("2010-10-05")},
                    {'id':2, 'name':'Ed Williams',
                            'create_date':op.inline_literal("2007-05-27")},
                    {'id':3, 'name':'Wendy Jones',
                            'create_date':op.inline_literal("2008-08-15")},
                ],
                multiinsert=False
            )

        When using :meth:`.Operations.inline_literal` in conjunction with
        :meth:`.Operations.bulk_insert`, in order for the statement to work
        in "online" (e.g. non --sql) mode, the
        :paramref:`~.Operations.bulk_insert.multiinsert`
        flag should be set to ``False``, which will have the effect of
        individual INSERT statements being emitted to the database, each
        with a distinct VALUES clause, so that the "inline" values can
        still be rendered, rather than attempting to pass the values
        as bound parameters.

        .. versionadded:: 0.6.4 :meth:`.Operations.inline_literal` can now
           be used with :meth:`.Operations.bulk_insert`, and the
           :paramref:`~.Operations.bulk_insert.multiinsert` flag has
           been added to assist in this usage when running in "online"
           mode.

        :param table: a table object which represents the target of the INSERT.

        :param rows: a list of dictionaries indicating rows.

        :param multiinsert: when at its default of True and --sql mode is not
           enabled, the INSERT statement will be executed using
           "executemany()" style, where all elements in the list of
           dictionaries are passed as bound parameters in a single
           list.   Setting this to False results in individual INSERT
           statements being emitted per parameter set, and is needed
           in those cases where non-literal values are present in the
           parameter sets.

           .. versionadded:: 0.6.4

          R�N(R:(RR;RoR�R�R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��sU(R	R
RR�R,R$R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�wstexecutetExecuteSQLOpcBs,eZdZdd�Zedd��ZRS(s#Represent an execute SQL operation.cCs||_||_dS(N(Retexecution_options(RReR�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s	cCs||d|�}|j|�S(s�
Execute the given SQL using the current migration context.

        In a SQL script context, the statement is emitted directly to the
        output stream.   There is *no* return result, however, as this
        function is oriented towards generating a change script
        that can run in "offline" mode.  For full interaction
        with a connected database, use the "bind" available
        from the context::

            from alembic import op
            connection = op.get_bind()

        Also note that any parameterized statement here *will not work*
        in offline mode - INSERT, UPDATE and DELETE statements which refer
        to literal values would need to render
        inline expressions.   For simple use cases, the
        :meth:`.inline_literal` function can be used for **rudimentary**
        quoting of string values.  For "bulk" inserts, consider using
        :meth:`.bulk_insert`.

        For example, to emit an UPDATE statement which is equally
        compatible with both online and offline mode::

            from sqlalchemy.sql import table, column
            from sqlalchemy import String
            from alembic import op

            account = table('account',
                column('name', String)
            )
            op.execute(
                account.update().\
                    where(account.c.name==op.inline_literal('account 1')).\
                    values({'name':op.inline_literal('account 2')})
                    )

        Note above we also used the SQLAlchemy
        :func:`sqlalchemy.sql.expression.table`
        and :func:`sqlalchemy.sql.expression.column` constructs to
        make a brief, ad-hoc table construct just for our UPDATE
        statement.  A full :class:`~sqlalchemy.schema.Table` construct
        of course works perfectly fine as well, though note it's a
        recommended practice to at least ensure the definition of a
        table is self-contained within the migration script, rather
        than imported from a module that may break compatibility with
        older migrations.

        :param sql: Any legal SQLAlchemy expression, including:

        * a string
        * a :func:`sqlalchemy.sql.expression.text` construct.
        * a :func:`sqlalchemy.sql.expression.insert` construct.
        * a :func:`sqlalchemy.sql.expression.update`,
          :func:`sqlalchemy.sql.expression.insert`,
          or :func:`sqlalchemy.sql.expression.delete`  construct.
        * Pretty much anything that's "executable" as described
          in :ref:`sqlexpression_toplevel`.

        :param execution_options: Optional dictionary of
         execution options, will be passed to
         :meth:`sqlalchemy.engine.Connection.execution_options`.
        R�(R:(RR;ReR�R<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s@N(R	R
RR-R,R$R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��stOpContainercBs;eZdZdd�Zd�Zd�Zed��ZRS(s-Represent a sequence of operations operation.cCs
||_dS(N(tops(RR�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,'scCs|jS(N(R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytis_empty*scCsttj|��S(N(R�R�t
_ops_as_diffs(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytas_diffs-sccsTxM|jD]B}t|d�rAx*|j|�D]}|Vq/Wq
|j�Vq
WdS(NR�(R�thasattrR�R"(Rt
migrationsR<tsub_op((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�0s
((R	R
RR,R�R�R$R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�%s
		tModifyTableOpscBs#eZdZdd�Zd�ZRS(sCContains a sequence of operations that all apply to a single Table.cCs,tt|�j|�||_||_dS(N(R�R�R,R(R)(RR(R�R)((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,=s	cCsDt|jdttg|jD]}|j�^q��d|j�S(NR�R)(R�R(R�treversedR�R R)(RR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR Bs
	(N(R	R
RR-R,R (((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�:st
UpgradeOpscBs/eZdZddd�Zd�Zd�ZRS(s�contains a sequence of operations that would apply to the
    'upgrade' stream of a script.

    .. seealso::

        :ref:`customizing_revision`

    tupgradescCs&tt|�jd|�||_dS(NR�(R�R�R,t
upgrade_token(RR�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,VscCs6ttg|jD]}|j�^q��|j(|S(N(R�R�R�R (Rt
downgrade_opsR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytreverse_intoZs,cCs|jtdg��S(NR�(R�tDowngradeOps(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR `s((R	R
RR,R�R (((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�Ls	R�cBs&eZdZddd�Zd�ZRS(s�contains a sequence of operations that would apply to the
    'downgrade' stream of a script.

    .. seealso::

        :ref:`customizing_revision`

    t
downgradescCs&tt|�jd|�||_dS(NR�(R�R�R,tdowngrade_token(RR�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,nscCs5tdttg|jD]}|j�^q���S(NR�(R�R�R�R�R (RR<((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR rs((R	R
RR,R (((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�dstMigrationScriptcBs�eZdZde�dddddd�Zed��Zejd��Zed��Z	e	jd��Z	ed��Z
ed��ZRS(	s�represents a migration script.

    E.g. when autogenerate encounters this object, this corresponds to the
    production of an actual script file.

    A normal :class:`.MigrationScript` object would contain a single
    :class:`.UpgradeOps` and a single :class:`.DowngradeOps` directive.
    These are accessible via the ``.upgrade_ops`` and ``.downgrade_ops``
    attributes.

    In the case of an autogenerate operation that runs multiple times,
    such as the multiple database example in the "multidb" template,
    the ``.upgrade_ops`` and ``.downgrade_ops`` attributes are disabled,
    and instead these objects should be accessed via the ``.upgrade_ops_list``
    and ``.downgrade_ops_list`` list-based attributes.  These latter
    attributes are always available at the very least as single-element lists.

    .. versionchanged:: 0.8.1 the ``.upgrade_ops`` and ``.downgrade_ops``
       attributes should be accessed via the ``.upgrade_ops_list``
       and ``.downgrade_ops_list`` attributes if multiple autogenerate
       passes proceed on the same :class:`.MigrationScript` object.

    .. seealso::

        :ref:`customizing_revision`

    cCs^||_||_||_||_||_||_|	|_|
|_||_||_	dS(N(
trev_idtmessagetimportstheadtsplicetbranch_labeltversion_patht
depends_ontupgrade_opsR�(RR�R�R�R�R�R�R�R�R�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR,�s									cCs@t|j�dkr$td��n|js1dS|jdSdS(szAn instance of :class:`.UpgradeOps`.

        .. seealso::

            :attr:`.MigrationScript.upgrade_ops_list`
        isrThis MigrationScript instance has a multiple-entry list for UpgradeOps; please use the upgrade_ops_list attribute.iN(tlent_upgrade_opsR.R-(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s	cCs*tj|�|_x|jD]}qWdS(N(Rtto_listR�(RR�telem((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��scCs@t|j�dkr$td��n|js1dS|jdSdS(s~An instance of :class:`.DowngradeOps`.

        .. seealso::

            :attr:`.MigrationScript.downgrade_ops_list`
        isvThis MigrationScript instance has a multiple-entry list for DowngradeOps; please use the downgrade_ops_list attribute.iN(R�t_downgrade_opsR.R-(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��s	cCs*tj|�|_x|jD]}qWdS(N(RR�R�(RR�R�((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR��scCs|jS(sA list of :class:`.UpgradeOps` instances.

        This is used in place of the :attr:`.MigrationScript.upgrade_ops`
        attribute when dealing with a revision operation that does
        multiple autogenerate passes.

        .. versionadded:: 0.8.1

        (R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytupgrade_ops_list�scCs|jS(sA list of :class:`.DowngradeOps` instances.

        This is used in place of the :attr:`.MigrationScript.downgrade_ops`
        attribute when dealing with a revision operation that does
        multiple autogenerate passes.

        .. versionadded:: 0.8.1

        (R�(R((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pytdowngrade_ops_list�sN(R	R
RR-R�R,R#R�tsetterR�R�R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyR�zs
(#tRRRtsqlalchemy.typesRtbaseRRR�tobjectRR
tregister_operationRRRRRRhRkRzR|R�R�R�R�R�R�R�R�R�R�R�R�(((sG/opt/alt/python27/lib/python2.7/site-packages/alembic/operations/ops.pyt<module>srnp��z~a�B�dcaK

Zerion Mini Shell 1.0