-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update column types in SQL storage models #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to adjust string size, but lets do it more precisely.
Also we need to find a TEXT alternative for LONG strings, some MUST accept unlimited sizes like scenarios
password = Column(TEXT) | ||
scenarios = Column(TEXT) | ||
machine_id = Column(String(512), unique=True) | ||
token = Column(String(512)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[critical] (!) token are currently over 1000char long !
MySQL supports the TEXT type, would it be a python sqlalchemy issue ? Two things:
@TheophileDiot is your mysql DB really not suporting TEXT type ? or is it when python tries to convert the sqlalchemy type TEXT ? |
@julienloizelet Lets make a list or cleverly thought string size that leave room for evolution where needed while being precise when we know it wont change
|
Hi @TheophileDiot and @rr404 , I've tested with a mysql 5.7 database. TEXT is supported but we have an error on the machine_id field because it is an index:
See https://stackoverflow.com/a/1827099/7497291 for some details. If we change TEXT to String(256) for machine_id, it works great. (Tested also with mariadb 10.8 and postgresql 11) I will create a PR to fix that. Other improvements (like setting accurate length for all fields) can be done later, I guess. Thanks |
Closing this PR because it will be fixed by #17 |
Description
This pull request addresses compatibility issues with MySQL databases caused by the TEXT column type. MySQL requires specific sizes in schema definitions, which were not being met by the TEXT type. To resolve this, the column types in SQL storage models are updated to String(512).
Changes Made
Modified Files