[Adonis V5] How to manage nullable Date / DateTime in models? #1498
-
Adonis version: 5.0.0-preview-rc-1.11 Hi, I've a model with a structure like like this:
In db, "nullableDateTime" is a datetime column which is nullable (and has default value of NULL). Now my question is: how can I edit this field when updating model to make it null again? Let's talk with steps.
And in database i have the correct datetime.
but if i make
Of course with a ts-ignore the error disappears and the first method works like a charm, but wondering if there's a better way of doing it and maintaining the types consistency. Any ideas? Might this be an issue? Thanks in advance PS: the same happens with Date values |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yup. Types needs to be fixed here. If you can create a PR, then I merge and release it. Or at least create an issue with |
Beta Was this translation helpful? Give feedback.
-
Created the issue adonisjs/lucid#590 Thanks a lot. Marking as answered |
Beta Was this translation helpful? Give feedback.
Yup. Types needs to be fixed here. If you can create a PR, then I merge and release it. Or at least create an issue with
@adonisjs/lucid
repo, so that it doesn't skip my mind