From d1ceed455bb4e445a6a2364822cfe33f09b901ce Mon Sep 17 00:00:00 2001 From: Tilman Krummeck Date: Mon, 13 Sep 2021 09:49:29 +0200 Subject: [PATCH] Revert optional constraint_name type on drop_constraint, doc fixes. --- alembic/op.pyi | 12 ++++++------ alembic/operations/ops.py | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/alembic/op.pyi b/alembic/op.pyi index 45da0cfa..01078dae 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -541,8 +541,8 @@ def create_foreign_key( 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 + :param constraint_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 @@ -643,8 +643,8 @@ def create_primary_key( 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 + :param constraint_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 @@ -850,7 +850,7 @@ def drop_column( """ def drop_constraint( - constraint_name: Optional[str], + constraint_name: str, table_name: str, type_: Optional[str] = None, schema: Optional[str] = None, @@ -1002,7 +1002,7 @@ def execute( op.execute("INSERT INTO table (foo) VALUES ('\:colon_value')") - :param sql: Any legal SQLAlchemy expression, including: + :param sqltext: Any legal SQLAlchemy expression, including: * a string * a :func:`sqlalchemy.sql.expression.text` construct. diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index d5ddbc94..c4712117 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -321,9 +321,9 @@ class CreatePrimaryKeyOp(AddConstraintOp): 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 + :param constraint_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 @@ -621,9 +621,9 @@ class CreateForeignKeyOp(AddConstraintOp): 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 + :param constraint_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 @@ -2389,7 +2389,7 @@ class ExecuteSQLOp(MigrateOperation): op.execute("INSERT INTO table (foo) VALUES ('\:colon_value')") - :param sql: Any legal SQLAlchemy expression, including: + :param sqltext: Any legal SQLAlchemy expression, including: * a string * a :func:`sqlalchemy.sql.expression.text` construct. -- 2.47.2