tabledump icon indicating copy to clipboard operation
tabledump copied to clipboard

bug: default 'string' values are missing the quotes

Open Gompje opened this issue 5 years ago • 3 comments

generated:

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

correct:

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

Gompje avatar Nov 19 '20 15:11 Gompje

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?

niektenhoopen avatar Jun 15 '21 14:06 niektenhoopen

@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.

Vmadmax avatar Jun 15 '21 17:06 Vmadmax

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

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

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

niektenhoopen avatar Jun 15 '21 19:06 niektenhoopen