Set CURRENT_TIMESTAMP as default value in strapi

642 Views Asked by At

I am using MySql in one of my project where backend is implemented using java and now I want to convert it to strapi project.

I have used some date field in database table and its default value is set to CURRENT_TIMESTAMP.

But I can not find any workaround to set CURRENT_TIMESTAMP as default value in strapi date fields.

I am happy to continue with either strapi v3 or v4.

Is it even possible?

Please help!

1

There are 1 best solutions below

0
Xzandro On

The only option I could think of is using lifecycle hooks in which you could set this date on creation. Probably not exactly what you are asking, but maybe this solution will suffice.