Skip to content

Is there a way to ignore column comments during revision --autogenerate #892

Answered by zzzeek
zlisde asked this question in Usage Questions
Discussion options

You must be logged in to vote

several, the most direct is to apply column_reflect to the Table class in env.py and set "comment" to blank:

from sqlalchemy import event
from sqlalchemy import Table

@event.listens_for(Table, 'column_reflect')
def receive_column_reflect(inspector, table, column_info):
    column_info['comment'] = None

the compare logic should skip entirely if the "comment" is reflected as None so the above should disable all comparison.

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@CaselIT
Comment options

@zzzeek
Comment options

@will-misslin
Comment options

@zzzeek
Comment options

@will-misslin
Comment options

Answer selected by CaselIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants