Describe the bug
Currently sqlalchemy Table.prefixes are not picked up by alembic when generating a migration using
alembic revision --autogenerate
Expected behavior
The prefixes are picked up by alembic. I've not tested it with other table keyboard, but maybe it's a more common theme.
To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
# Add a new table like this one to the metadata
import sqlalchemy as sa
sa.Table(
"foo",
metadata,
sa.Column("id", sa.Integer(), primary_key=True),
sa.Column("other", sa.Integer),
prefixes=["UNLOGGED"],
)
Error
# The reflected migration code generated is
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"foo",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("other", sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###
Versions.
- OS: windows
- Python: 3.7.7
- Alembic: 1.4.2
- SQLAlchemy: 1.3.18
- Database: postgres
- DBAPI: pycopg2
Additional context
Manually adding prefixes=[...] to the create_table function after autogenerate does work correctly, so this is just a nice to have feature
Have a nice day!
Describe the bug
Currently sqlalchemy
Table.prefixesare not picked up by alembic when generating a migration usingalembic revision --autogenerateExpected behavior
The
prefixesare picked up by alembic. I've not tested it with other table keyboard, but maybe it's a more common theme.To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
Error
Versions.
Additional context
Manually adding
prefixes=[...]to thecreate_tablefunction after autogenerate does work correctly, so this is just a nice to have featureHave a nice day!