-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
max_length does not work in Fields #126
Comments
Try this:
|
This started working for some reason, genuinely not sure what resolved; maybe new version of fastapi? |
How is it even related to FastAPI? SQLModel is still at version 0.0.4. |
Fair point. I'm just genuinely not sure why it started working. waited a couple days, didnt even close the project, and it started working. |
I ended up just leaving the max_length args in there and it seemed to start working. could not tell you why the errors earlier were consistently getting thrown. |
2 years passed, is There any official solution? |
@PaleNeutron this is what worked for me when migrating the model to mysql8. Just adding the
|
First Check
Commit to Help
Example Code
Description
When running the above code, I get a
ValueError: On field "LocationName" the following field constraints are set but not enforced: max_length
I also tried pydantic's documentation by changing the 'str' typing to
constr(max_length=255)
to no avail.Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9.4
Additional Context
No response
The text was updated successfully, but these errors were encountered: