obtaining the current timestamp in mysql in Valetina studio

202 Views Asked by At

I am learnig laravel from Laracast videos and using Valentina Studio as GUI to have a look at the database and connect using mysql . I have composer and mariadb installed on linux. so, when I was creating a new field in an empty table which has created_at and updated_at as columns, I used NOW() expecting that it would take the current timestamp. But it(valentina studio) shows

>  " Error (1292) 22007: Incorrect datetime value: 'now()' for column 'created_at' at row 1"

Ps: I have looked at others answers related to timestamps in mysql, but I believe I may be missing something related to Valentina studio commands.

2

There are 2 best solutions below

0
rosscooper On BEST ANSWER

See the link, although for created_at and updated_at you can just use $table->timestamps();

https://stackoverflow.com/a/20822267/2419954

2
J. Doe On

Change NOW() to CURRENT_TIMESTAMP()