We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is a :
bug
CakePHP Version: 4.3.8
Migrations plugin version: 3.5.1
Bake plugin version (if relevant): 2.7.0
Database server: 10.3.22-MariaDB-0+deb10u1
PHP Version: 8.0.13
Platform / OS: Debian
Created a migration file
bin/cake bake migration_snapshot Initial
The relevant table:
CREATE TABLE `mod_ti_tiles` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `theme_id` INT(11) UNSIGNED NOT NULL, `typ` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0', `width` SMALLINT(6) NOT NULL DEFAULT '0', `height` SMALLINT(6) NOT NULL DEFAULT '0', `kachel` LONGTEXT NOT NULL DEFAULT '{}' COLLATE 'utf8mb4_general_ci', `order` TINYINT(4) UNSIGNED NOT NULL COMMENT 'starting at 0', PRIMARY KEY (`id`) USING BTREE, INDEX `theme_id` (`theme_id`) USING BTREE ) COLLATE='utf8mb4_general_ci' ENGINE=InnoDB ;
The table column 'kachel' of type LONGTEXT contains data in json format. Therefore it has a default value of '{}'.
The code the migrator created for this column:
->addColumn('kachel', 'text', [ 'default' => '\'{}\'', 'limit' => 4294967295, 'null' => false, ])
If I run my tests with this migration file, it also inserts the quotes into the db value. And of course the json is broken.
I dont know if it's relevant, so I'll mention it: My database config has 'quoteIdentifiers' => true,
I changed the migration file manually to:
->addColumn('kachel', 'text', [ 'default' => '{}', 'limit' => 4294967295, 'null' => false, ])
Now my tests are running fine again.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
This is a :
bug
CakePHP Version: 4.3.8
Migrations plugin version: 3.5.1
Bake plugin version (if relevant): 2.7.0
Database server: 10.3.22-MariaDB-0+deb10u1
PHP Version: 8.0.13
Platform / OS: Debian
What you did
Created a migration file
The relevant table:
The table column 'kachel' of type LONGTEXT contains data in json format.
Therefore it has a default value of '{}'.
Actual Behavior
The code the migrator created for this column:
If I run my tests with this migration file, it also inserts the quotes into the db value.
And of course the json is broken.
I dont know if it's relevant, so I'll mention it:
My database config has 'quoteIdentifiers' => true,
Expected Behavior
I changed the migration file manually to:
Now my tests are running fine again.
The text was updated successfully, but these errors were encountered: