sqlalchemy / alembic

A database migrations tool for SQLAlchemy.
MIT License
2.61k stars 234 forks source link

Fix postgres detect serial in autogenerate (#1479) #1486

Closed JabberWocky-22 closed 1 month ago

JabberWocky-22 commented 1 month ago

Fixes: https://github.com/sqlalchemy/alembic/issues/1479

Description

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

This pull request is:

Have a nice day!

JabberWocky-22 commented 1 month ago

change log and more test has been added Please review it XD

CaselIT commented 1 month ago

thanks. I'll bring in it gerrit were the complete pipeline can run

sqla-tester commented 1 month ago

New Gerrit review created for change 24df8f906d281df92c531df5a9e1f64d8cdb8527: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5333

sqla-tester commented 1 month ago

Michael Bayer (zzzeek) wrote:

it's documented here: https://www.postgresql.org/docs/current/datatype-oid.html

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5333

sqla-tester commented 1 month ago

Michael Bayer (zzzeek) wrote:

code review left on gerrit

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5333

sqla-tester commented 1 month ago

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5333 has been merged. Congratulations! :)