]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Fix postgres detect serial in autogenerate (#1479)
authorzhouyizhen <zhouyizhen@metrodata.tech>
Wed, 5 Jun 2024 19:28:53 +0000 (15:28 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Wed, 5 Jun 2024 19:28:53 +0000 (15:28 -0400)
commit34dbe6afa27db5288629e1ec6fe5fbcd675a3b2f
treefe1e21b1660d2e8fdf297bce5c22e87b4f579197
parentade17cfd8dd1a12d6babceb24126511ddab1085a
Fix postgres detect serial in autogenerate (#1479)

<!-- Provide a general summary of your proposed changes in the Title field above -->
Fixes: https://github.com/sqlalchemy/alembic/issues/1479
### Description
<!-- Describe your changes in detail -->
In https://github.com/sqlalchemy/alembic/issues/73, it tries to detact postgresql serial in autogenerate, so it won't take `nextval('seq'::regclass)` as server default for that column.
But it takes not effect for tables not in search path. This PR fixed it.

### 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: #1486
Pull-request: https://github.com/sqlalchemy/alembic/pull/1486
Pull-request-sha: 24df8f906d281df92c531df5a9e1f64d8cdb8527

Change-Id: I50276875bfb1d4f920f0fcd20136337ae09b5384
alembic/ddl/postgresql.py
docs/build/unreleased/1479.rst [new file with mode: 0644]
tests/test_postgresql.py