]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
[Fixes #1671] Passthrough `dialect_kwargs` to `ops.create_foreign_key()`
authorJustin Malin <justin@joincandidhealth.com>
Thu, 12 Jun 2025 19:56:36 +0000 (15:56 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Thu, 12 Jun 2025 19:56:36 +0000 (15:56 -0400)
commit229c9f858d11759abd0746d3bf6f7a6a4e001a50
tree4013d26f5d794d8abe6fd4208dc0f99af1564b24
parentc072e67aa91eb871a8123eaa26393fd568cc3f2e
[Fixes #1671] Passthrough `dialect_kwargs` to `ops.create_foreign_key()`

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->
Fixes #1671

SqlAlchemy supports adding dialect kwargs for foreign keys, as does `op.create_foreign_key()`, but the renderer for `ops.CreateForeignKeyOp` does not pass through `dialect_kwargs`. An example of this is `postgresql_not_valid`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #1672
Pull-request: https://github.com/sqlalchemy/alembic/pull/1672
Pull-request-sha: 246a363617b1a4a5885d2fed32e82f3312b386ef

Change-Id: I5dabbc4dc408c13883a6225733d7c38f8daeee38
alembic/autogenerate/render.py
docs/build/unreleased/1672.rst [new file with mode: 0644]
tests/test_autogen_render.py
tests/test_postgresql.py