Use ForeignKey target accessors instead of splitting colspecs - #1861
Use ForeignKey target accessors instead of splitting colspecs#1861gyanu2507 wants to merge 1 commit into
Conversation
SQLAlchemy 2.1 tracks schema/table/column separately so a dot inside a name is not a separator. Use those public attributes when present and keep the old split as a fallback for 2.0.
|
Hi, and thanks for the pull request! This project accepts pull requests only for issues that a maintainer has already marked with the open for pull requests label. That way we can settle on an approach before anyone spends time writing code. This pull request references issue #1860, which hasn't been marked open for pull requests, so the change isn't authorized yet and I'm closing it automatically. Once a maintainer adds the label to #1860, reopen this pull request and it will stay open. If #1860 needs more detail before that can happen, a complete runnable example is usually the missing piece, and adding one to the issue is the fastest way to get there. This is automatic and procedural. It isn't a judgment on your change, and nothing you've written here is lost. Thanks for your interest in the project! |
Alembic was splitting ForeignKey._get_colspec() on ".", which cannot tell a dot inside a name from the separator between schema/table/column. SQLAlchemy 2.1 exposes target_tokens / target_table_key / target_column for this.
Wired those in through sqla_compat, with the old split as a fallback on 2.0.
Fixes #1860