implement compare_against_backend for SQLAlchemy
I have to change this:
email = db.Column(db.String(255))
to
email = db.Column(db.Text)
but nothing is detected during migration (with compare_type=True).
The only way to detect this case is to set a length to the email field like this:
email = db.Column(db.Text(length=16777215)
hi there -
this depends highly on the kind of database you are using, may I please know what it is?
mysql/mariadb
there is currently no type comparison that is more fine grained than the so-called "type affinity" of a datatype, such as Numeric vs. String. Detailed comparison of types, such as to detect that String() on MySQL renders VARCHAR which is not the same as TEXT, as well as that String(50) has a different length than String(100), needs to happen within the type objects and usually on a per-dialect level on the SQLAlchemy side and there is no timeline for this to be implemented.