0

When I go into Laravel Voyager's admin and attempt to create a new table, everything goes fine until I add timestamps. I have my project set to use mysql and I realize this is an issue with my mysql settings, but I can't seem to find an answer that works. Here's the error

generic.exception: An exception occurred while executing 'ALTER TABLE jobs ADD created_at timestamp null NOT NULL, ADD updated_at timestamp null NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'updated_at'

I tried the top solution at this stack overflow post, restarted mysql and it didn't work. I get the same error as before.

I've gotten this to work with postgresql but I'd like to keep it with mysql since that's what I'm familiar with.

brunam
  • 825
  • 2
  • 14
  • 26
  • I set Laravel's mysql setting of strict to false and that seems to fix it but is this going to be a long term issue? – brunam Apr 07 '18 at 19:44
  • Well, the default value is null, but you've set the column to not null. Not sure how this is configured in Voyager, but seems like a problem with your column definition. – Devon Bessemer Apr 07 '18 at 19:55
  • Voyager sets the timestamps automatically which I guess would make it a Voyager bug then instead of a MySQL one. – brunam Apr 07 '18 at 19:57

0 Answers0