lmsqueezy / laravel

A package to easily integrate your Laravel application with Lemon Squeezy.
https://lemonsqueezy.com
MIT License
503 stars 50 forks source link

Getting `Syntax error or access violation: 1067 Invalid default value for 'ordered_at'` column #84

Closed Rijoanul-Shanto closed 5 months ago

Rijoanul-Shanto commented 5 months ago

Lemon Squeezy for Laravel Version

1.5.2

Laravel Version

11

PHP Version

8.2.17

Description

getting SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'ordered_at' (Connection: mysql, SQL: create table 'lemon_squeezy_orders'...) while running the migration.

Database: MariaDB 10.6.16

Steps To Reproduce

  1. Add the package
  2. Run migration
heyjorgedev commented 5 months ago

Did you get this error while running the migrations? If there is no data on the table how is it complaining about not being nullable?

driesvints commented 5 months ago

Yeah bit weird this one.. this should definitely come from data being inserted into the table. I see the it's with a create table statement but just super odd...

Rijoanul-Shanto commented 5 months ago

@heyjorgedev @driesvints Please refer to the reference below. I have a completely new database with zero tables in it.

image

And after running the migration, here's what it looks like: image

Rijoanul-Shanto commented 5 months ago

@heyjorgedev @driesvints Please refer to the reference below. I have a completely new database with zero tables in it.

image

And after running the migration, here's what it looks like: image

It seems that the issue isn't occurring with a freshly installed Laravel app. Let me delve deeper into what's causing the actual problem.

Rijoanul-Shanto commented 5 months ago

@heyjorgedev @driesvints

I've tried migrating in both a fresh Laravel app and a fresh MySQL and MariaDB database, and it seems to be related to my previous MariaDB configuration rather than the package. So, I'm closing this issue for now. Thanks for taking the time to reach out. I'll provide an update once I've pinpointed the actual issue. Initially, I thought the DB strict mode might have caused the issue, but I'm not certain yet.