Replies: 1 comment 1 reply
-
Constraints aren't duplicated by default, including foreign keys. Are you seeing this behavior?
This is what it was intended for! Another option is to use a custom event model I'm not sure what feature you are hoping for. A setting that makes every history field nullable by default? A setting to specify which fields are nullable? There are already quite a few arguments to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Tha case I faced was that I have a tracked nullable field. Now, I want to make that field non-nullable by setting "null=False" on the field. But there are some rows in events that contain null values and I don't want to change those rows. I needed the ability of a general setting to ingonre null=False on any field. I don't think any other constraints like "unique=True" are needed to be duplicated into event models either. The solution I came up with was overriding the field via the "attrs" argument of pghistory.track decorator I used on my model.
Beta Was this translation helpful? Give feedback.
All reactions