-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: fixed behavior for updated_at
field when updating the model
#166
Conversation
In this case, the Re: the initial population, I don't disagree that it should not be populated initially, but I often found that it was easier to work with an object you know is not null. Let's see how the tests suite executes and we can see if anything different is required. |
@cofin I didn't notice that this field is required in the database. As for your explanation, I agree: it should be more convenient with a non-null value. |
@SergeyKomVl quick question, are you using advanced alchemy in Litestar or on it's own? The reason I ask is that this should be taken care of by the listener that gets attached. So, in theory, you don't even need this configuration added to the model. However, it occurred to me that, depending on how you are using the library, you may not invoke a configuration object. Take a look at the test cases here and let me know if you still need this change. |
Documentation preview will be available shortly at https://litestar-org.github.io/advanced-alchemy-docs-preview/166 |
@cofin |
Description
fixed behavior for
updated_at
field when updating the modelWhen the model is created, it is not necessary to fill in the 'updated_at` field.
But when updating the model, it needs to be updated automatically.
hotfix
Returned the default value for the field.
Closes