Skip to content
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

Can not to use relation to table with unsigned pk #1602

Closed
mixartemev opened this issue May 4, 2024 · 2 comments
Closed

Can not to use relation to table with unsigned pk #1602

mixartemev opened this issue May 4, 2024 · 2 comments

Comments

@mixartemev
Copy link

Describe the bug

pydantic_core._pydantic_core.ValidationError: 1 validation error for ListItem
msg.chat_id
  Input should be greater than or equal to 1 [type=greater_than_equal, input_value=-1001294902609, input_type=int]
    For further information visit https://errors.pydantic.dev/2.7/v/greater_than_equal

To Reproduce
Just to have negative values in PK field of related table

Expected behavior
Do not get validation error

Additional context
Cause: constraint ge is reseting to 1 for relational field (where self.reference is not None)

"ge": 1 if self.generated or self.reference else -9223372036854775808,

@abondar
Copy link
Member

abondar commented May 7, 2024

Yeah, it's a little bit problematic

Probably should just delete dynamic lower bound, as we don't enforce it anyhow on db level
Will remove it in next version

@abondar
Copy link
Member

abondar commented May 24, 2024

Should be fixed in 0.21.0, now int fields are always signed

@abondar abondar closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants