Primary key field raises FieldDefinitionError with server_default #46
Replies: 5 comments 4 replies
-
@rorik302 could you provide some more details, please? Like what are you trying to achieve, what is your use case. Reason being it's because I'm doing now a patch and this could be part of the fix . EDIT: there a fix coming for these situations. By the time this was released the server_default wasn't supported |
Beta Was this translation helpful? Give feedback.
-
@rorik302 to unblock you, try this: id: UUIDField(primary_key=True, default=func.gen_random_uuid) |
Beta Was this translation helpful? Give feedback.
-
@rorik302 it looks like a regression. I will have a look first thing tomorrow before releasing. Hopefully this gets done and released tomorrow |
Beta Was this translation helpful? Give feedback.
-
This is now being pushed to testing and fixed. Hopefully we will run a release today. Nice catch @rorik302 but before doing that, to test this, could you checkout the branch |
Beta Was this translation helpful? Give feedback.
-
Sorry, had an issue there. Could you please try again (pull the latest branch)? |
Beta Was this translation helpful? Give feedback.
-
Primary key field raises FieldDefinitionError with server_default. For example
id: UUID = UUIDField(primary_key=True, server_default=func.gen_random_uuid())
raisesedgy.exceptions.FieldDefinitionError: Primary keys other then IntegerField and BigIntegerField, must provide a default or a server_default.
Beta Was this translation helpful? Give feedback.
All reactions