You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported by: Jean-Paul Calderone (Bitbucket: exarkun, GitHub: exarkun)
A column with type TIMESTAMP ends up with a Column(DateTime()) in the generated model.
This is presumably because Model.__init__ tries to down-adapt TIMESTAMP to something generic based on the SQLAlchemy class hierarchy and TIMESTAMP subclasses DateTime in SQLAlchemy.
This definitely breaks the type of the column and does so very obviously when the column has a default like CURRENT_TIMESTAMP which is not an allowed value for a MySQL DATETIME column.
Original comment byAlex Grönholm (Bitbucket: agronholm, GitHub: agronholm):
What do you suggest as a solution? PostgreSQL accepts CURRENT_TIMESTAMP for datetime columns, so the problem isn't universal. If I start adding fixes for backend specific quirks, there'll be no end to those.
Original comment byAlex Grönholm (Bitbucket: agronholm, GitHub: agronholm):
I wonder if it'd be possible to check if the adapted column type is still rendered as the original type. That would solve this problem without having to resort to black/whitelists.
Originally reported by: Jean-Paul Calderone (Bitbucket: exarkun, GitHub: exarkun)
A column with type TIMESTAMP ends up with a Column(DateTime()) in the generated model.
This is presumably because
Model.__init__
tries to down-adapt TIMESTAMP to something generic based on the SQLAlchemy class hierarchy and TIMESTAMP subclasses DateTime in SQLAlchemy.This definitely breaks the type of the column and does so very obviously when the column has a default like
CURRENT_TIMESTAMP
which is not an allowed value for a MySQL DATETIME column.The text was updated successfully, but these errors were encountered: