-
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
db.model schema - string column without size to default to length 255 #330
base: develop
Are you sure you want to change the base?
Conversation
When a column type is Python "str" or String type without max length, default to 255. Otherwise, DB other than sqlite3 cannot have VARCHAR without size. (2) Add the schema deployment to MySQL in github action tests so we'd catch the db.model change that doesn't work.
Please do not set the string length to 255 by default. This will be incorrect. |
See this file for the lengths of strings to use for in models: https://github.com/arXiv/modapi/blob/develop/modapi/tables/arxiv_models.py |
@bdc34 arxiv_model.py uses Column(Text) which has no size which also fails. So, if not 255, what does it use for default? I guess "str" has no default length. Following ones Text: table arXiv_bib_feeds column prune_ids for example has no size. I think it is defaulting to 255 from the DDL. Ones failing is "str" and if I replace it with Text, it would be the same.
it is probably more precise to auto-gen the models from DDL. |
sqlalchemy's
I don't think so:
|
On to test with arxiv-browse.
(1) db.models - When a column type is Python "str" or String type without max length, default to 255. Otherwise, DB other than sqlite3 cannot have VARCHAR without size.
(2) Add the schema deployment to MySQL in github action tests so we'd catch the db.model change that doesn't work.