Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: default 'string' values are missing the quotes #26

Open
Gompje opened this issue Nov 19, 2020 · 3 comments
Open

bug: default 'string' values are missing the quotes #26

Gompje opened this issue Nov 19, 2020 · 3 comments

Comments

@Gompje
Copy link

Gompje commented Nov 19, 2020

generated:

$table->string('timezone', 100)->default(Europe/Brussels);

correct:

$table->string('timezone', 100)->default('Europe/Brussels');
@niektenhoopen
Copy link

This seems to be broken in #19 where the compatibility with string default values is removed. Maybe @Vmadmax is using a different database engine than you (/us)?

@Vmadmax I am on MySQL 8 and run into the same issue as @Gompje. Any idea why you removed the JSON.stringify part?

@Vmadmax
Copy link
Contributor

Vmadmax commented Jun 15, 2021

@Gompje @niektenhoopen Yes I can confirm, it's an MySQL version 8 bug. It's working correct in 5.7.
In my test, 5.7 will return 'de' and 8 only de

We need to check the selected MySQL version, but I have no idea where to get this information.

@niektenhoopen
Copy link

niektenhoopen commented Jun 15, 2021

@Vmadmax Probably only @huyphams can tell us. The only thing I could find about context is: TablePlus/TablePlus#1532

context.driver() tells us the driver but not the version...

We could run a query SELECT VERSION(); but that feels 'ugly'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants