Bake snapshot losing structure data
dereuromark opened this issue · comments
Description
While trying to squash all migrations files into one by rebaking a initial snapshot
the diff seems to outline quite a bit of data loss on the structure of the sql schema
I wonder which ones of those could and should be fixed:
dereuromark/cakephp-sandbox@8138028
All of those are on MySQL
So to outline the important ones:
binary
- `image` blob DEFAULT NULL,
+ `image` binary(255) DEFAULT NULL,
For fixture data
'image' => ['type' => 'binary', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null],
and generated migrations schema
->addColumn('image', 'binary', [
'default' => null,
'limit' => null,
'null' => true,
])
tinyint for enum
- `status` tinyint(2) UNSIGNED NOT NULL DEFAULT 0,
+ `status` tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
For
'status' => ['type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2],
and generated
->addColumn('status', 'tinyinteger', [
'default' => '0',
'limit' => null,
'null' => false,
'signed' => false,
])
This refs cakephp/migrations#502
Bake Version
3.x
PHP Version
8.2