| Server IP : 93.115.150.27 / Your IP : 216.73.216.221 Web Server : LiteSpeed System : Linux host2.azar.host 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 User : dorfakkh ( 1797) PHP Version : 8.1.34 Disable Function : show_source, system, passthru, exec, popen, proc_open, mail MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib/python3.7/site-packages/alembic/operations/__pycache__/ |
Upload File : |
B
�M!Vr@ � @ s� d dl mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ d d l Z d d l
Z
d
Zyd dlm
Z
W n d Z
Y nX G dd
� d
ej�ZG dd� de�Zd S )� )�contextmanager� )�util)�sqla_compat� )�batch)� schemaobj)�exec_N)�
Operations�BatchOperations)�convc @ s� e Zd ZdZe�� Zddd�Zeddd��Z edd� �Z
eed d
� ��Zedddde�
� de�
� dfd
d��Zdd� Zdd� Zdd� Zddd�Zdd� ZdS )r
a� Define high level migration operations.
Each operation corresponds to some schema migration operation,
executed against a particular :class:`.MigrationContext`
which in turn represents connectivity to a database,
or a file output stream.
While :class:`.Operations` is normally configured as
part of the :meth:`.EnvironmentContext.run_migrations`
method called from an ``env.py`` script, a standalone
:class:`.Operations` instance can be
made for use cases external to regular Alembic
migrations by passing in a :class:`.MigrationContext`::
from alembic.migration import MigrationContext
from alembic.operations import Operations
conn = myengine.connect()
ctx = MigrationContext.configure(conn)
op = Operations(ctx)
op.alter_column("t", "c", nullable=True)
Note that as of 0.8, most of the methods on this class are produced
dynamically using the :meth:`.Operations.register_operation`
method.
Nc C s. || _ |dkr|j| _n|| _t�|�| _dS )z�Construct a new :class:`.Operations`
:param migration_context: a :class:`.MigrationContext`
instance.
N)�migration_context�implr Z
SchemaObjectsZ
schema_obj)�selfr
r � r �H/opt/alt/python37/lib/python3.7/site-packages/alembic/operations/base.py�__init__4 s
zOperations.__init__c s � ��fdd�}|S )a� Register a new operation for this class.
This method is normally used to add new operations
to the :class:`.Operations` class, and possibly the
:class:`.BatchOperations` class as well. All Alembic migration
operations are implemented via this system, however the system
is also available as a public API to facilitate adding custom
operations.
.. versionadded:: 0.8.0
.. seealso::
:ref:`operation_plugins`
c
s8 �d krt | ��}|j}nt | ��}|j}t�|�}|d }|dd� ddgksTt�dg|dd�<