1

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.

Nitz
  • 45
  • 9
  • Few days ago, it took that command NOW() and was displaying 0000-00-00 00:00:00. How do I make it take the exact current time? – Nitz Jul 11 '18 at 10:34

2 Answers2

1

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

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

rosscooper
  • 1,976
  • 3
  • 16
  • 29
0

Change NOW() to CURRENT_TIMESTAMP()

J. Doe
  • 1,682
  • 11
  • 22
  • @Nitz your create table via migration?) – J. Doe Jul 11 '18 at 10:40
  • Yes.I did ' php artisan migrate ' Also the main question is, will the valentina studio field box take these sql commands correctly or is there any other command specific to valentina studio to get the timestamp ? – Nitz Jul 11 '18 at 10:41