Skip to content

Migrations\Db\Table\Column::setFixed(): Argument #1 ($fixed) must be of type bool, null given #1046

@LordSimal

Description

@LordSimal

Version: 5.0.2

Just executed bin/cake bake migration_snapshot Something --generate-only as I regularely reset my migrations

After cleaning it up and splitting all the tables into their respective private plugins I tried to re-execute my tests and therefore run my newly generated migrations.

But I get this error:

kevin•Documents/sunlime/alfred(master⚡)» composer test                                                                                                                                                                                          [20:29:32]
Current error level: E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR
PHPUnit 13.0.5 by Sebastian Bergmann and contributors.

Error in bootstrap script: TypeError:
Migrations\Db\Table\Column::setFixed(): Argument #1 ($fixed) must be of type bool, null given, called in /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Db/Table/Column.php on line 881
#0 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Db/Table/Column.php(881): Migrations\Db\Table\Column->setFixed(NULL)
#1 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Db/Adapter/AbstractAdapter.php(370): Migrations\Db\Table\Column->setOptions(Array)
#2 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Db/Adapter/AdapterWrapper.php(103): Migrations\Db\Adapter\AbstractAdapter->getColumnForType('softwarecode', 'binary', Array)
#3 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Db/Table.php(365): Migrations\Db\Adapter\AdapterWrapper->getColumnForType('softwarecode', 'binary', Array)
#4 /Users/kevin/Documents/sunlime/alfred/plugins/AlfredStaffMembers/config/Migrations/20240630123000_InitialStaffMembersSchema.php(21): Migrations\Db\Table->addColumn('softwarecode', 'binary', Array)
#5 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Migration/Environment.php(116): InitialStaffMembersSchema->up()
#6 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Migration/Manager.php(528): Migrations\Migration\Environment->executeMigration(Object(InitialStaffMembersSchema), 'up', false)
#7 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Migration/Manager.php(499): Migrations\Migration\Manager->executeMigration(Object(InitialStaffMembersSchema), 'up', false)
#8 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Migration/BuiltinBackend.php(96): Migrations\Migration\Manager->migrate(20240630123000)
#9 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/Migrations.php(114): Migrations\Migration\BuiltinBackend->migrate(Array)
#10 /Users/kevin/Documents/sunlime/alfred/vendor/cakephp/migrations/src/TestSuite/Migrator.php(116): Migrations\Migrations->migrate(Array)
#11 /Users/kevin/Documents/sunlime/alfred/tests/bootstrap.php(62): Migrations\TestSuite\Migrator->runMany(Array)
#12 /Users/kevin/Documents/sunlime/alfred/vendor/phpunit/phpunit/src/TextUI/Configuration/BootstrapLoader.php(61): include_once('/Users/kevin/Do...')
#13 /Users/kevin/Documents/sunlime/alfred/vendor/phpunit/phpunit/src/TextUI/Configuration/BootstrapLoader.php(36): PHPUnit\TextUI\Configuration\BootstrapLoader->load('/Users/kevin/Do...')
#14 /Users/kevin/Documents/sunlime/alfred/vendor/phpunit/phpunit/src/TextUI/Application.php(132): PHPUnit\TextUI\Configuration\BootstrapLoader->handle(Object(PHPUnit\TextUI\Configuration\Configuration))
#15 /Users/kevin/Documents/sunlime/alfred/vendor/phpunit/phpunit/phpunit(104): PHPUnit\TextUI\Application->run(Array)
#16 /Users/kevin/Documents/sunlime/alfred/vendor/bin/phpunit(122): include('/Users/kevin/Do...')
#17 {main}
Script phpunit --colors=always --testsuite app,covid,dashboard,deploy,dns,documentations,google,maintenances,mealorders,odoo,projects,tools,staffmembers,standBy handling the test event returned with error code 2

The linked migration error is this generated column:

->addColumn('softwarecode', 'binary', [
    'default' => null,
    'fixed' => null,
    'limit' => null,
    'null' => false,
])

My schema for that table is this:
Image

I am on MariaDB 12.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions