Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix constraint_name type of create_foreign_key #914

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions alembic/op.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def create_exclude_constraint(
"""

def create_foreign_key(
constraint_name: str,
constraint_name: Optional[str],
source_table: str,
referent_table: str,
local_cols: List[str],
Expand Down Expand Up @@ -541,9 +541,9 @@ 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
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
Expand Down Expand Up @@ -618,7 +618,7 @@ def create_index(
"""

def create_primary_key(
constraint_name: str,
constraint_name: Optional[str],
table_name: str,
columns: List[str],
schema: Optional[str] = None,
Expand All @@ -643,9 +643,9 @@ 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
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
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 9 additions & 9 deletions alembic/operations/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def to_constraint(
def create_primary_key(
cls,
operations: "Operations",
constraint_name: str,
constraint_name: Optional[str],
table_name: str,
columns: List[str],
schema: Optional[str] = None,
Expand All @@ -321,9 +321,9 @@ 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
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
Expand Down Expand Up @@ -588,7 +588,7 @@ def to_constraint(
def create_foreign_key(
cls,
operations: "Operations",
constraint_name: str,
constraint_name: Optional[str],
source_table: str,
referent_table: str,
local_cols: List[str],
Expand Down Expand Up @@ -621,9 +621,9 @@ 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
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
Expand Down Expand Up @@ -2389,7 +2389,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.
Expand Down