Closed robin-dongbin closed 1 year ago
Hi, what database engine and version are you using?
innodb 8.0.29
in your config/database.php
, change the value of engine in mysql connections to innodb
'engine' => 'innodb'
in your
config/database.php
, change the value of engine in mysql connections to innodb'engine' => 'innodb'
Doesn't work
can you screen your migration ? i mean that language file
Just copied from the doc.
Schema::create('language_lines', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('group')->index();
$table->string('key')->index();
$table->json('text')->default('[]');
$table->timestamps();
});
Same
i think you need to upgrade, check here
Issue not related to the package
As per Laravel Documentation
The default modifier accepts a value or an Illuminate\Database\Query\Expression instance. Using an Expression instance will prevent Laravel from wrapping the value in quotes and allow you to use database specific functions. One situation where this is particularly useful is when you need to assign default values to JSON columns
So the migration should be:
Schema::create('language_lines', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('group')->index();
$table->string('key')->index();
$table->json('text')->default(new \Illuminate\Database\Query\Expression('(JSON_ARRAY())'));
$table->timestamps();
});
Hope this helps :)
It really does help!
Maybe a PR to change the README would be nice :)
I've done the PR -> https://github.com/kenepa/translation-manager/pull/20
SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'text' can't have a default value