New upgrade operations detected: [('remove_table', Table('some_table', MetaData(), Column('id', UUID(), table=<some_table>, primary_key=True, nullable=False, default=CallableColumnDefault(<function uuid4 at 0x7f18789fafc0>)), Column('url', String(), table=<some_table>, nullable=False), Column('other_table_id', String(), ForeignKey('other_table.id'), table=<some_table>, nullable=False), schema=None)), ('remove_table', Table('another_table', MetaData(), Column('id', UUID(), table=<another_table>, primary_key=True, nullable=False, default=CallableColumnDefault(<function uuid4 at 0x7f187883f4c0>)), Column('url', String(), table=<another_table>, nullable=False), Column('a_column', String(), table=<another_table>), Column('b_column', String(), table=<another_table>), Column('external_id', Integer(), ForeignKey('external_table.id'), table=<another_table>, nullable=False), schema=None))]
Describe the use case
We're using
alembic checkin our CI to decorate pull requests with potentially missing DB changes.The output of
alembic checkis added as a comment in the pull request, but it's hardly readable.Example Use
What could be output instead, which would summarize it better:
or even
Additional context
Note that in above expectations I'd be delighted that we can have the
if_existsoption which is currently added by my rewriter.What I can propose as solutions:
as_sqloras_opstocheckcommand, so that we can specify output formatsAutogenerateDiffsDetectedso that I may make a wrapper above the command and catch it to make the display that suits me best. passing diffs/migration_script would be sufficient to change renderingHave a nice day!