You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix $namespace = null in pre-existing test classes to prevent vendor migrations running against test DB #4819
Several test classes set protected $namespace = null, which causes CI4's migration runner to discover and execute migrations from all registered namespaces — including vendor packages like CodeIgniter\Queue. Those vendor migrations create tables without the app's extra columns (e.g. batch_id on queue_jobs), causing failures like:
CodeIgniter\Database\Exceptions\DatabaseException: Unknown column 'batch_id' in 'field list'
Only app-namespace migrations should ever run against the test database.
AGENTS.md fix needed
The bootstrap example in the Testing section currently shows:
protected$namespace = null;
This must be corrected to:
protected$namespace = 'App';
And an explicit rule should be added stating: always set $namespace = 'App' — never null.
Test files to fix
The following pre-existing test files set $namespace = null and need it changed to 'App':
tests/Models/AppconfigTest.php
tests/Helpers/migration_helperTest.php
tests/Models/ItemBulkUpdateTest.php
tests/Models/ItemTaxesMultipleTest.php
tests/Models/ItemSearchTest.php
tests/Controllers/TaxesControllerTest.php
tests/Models/ItemTest.php
tests/Controllers/NoAccessControllerTest.php
tests/Controllers/OfficeControllerTest.php
tests/Controllers/ReceivingsControllerTest.php
tests/Models/Stock_locationTest.php
tests/Models/TaxTest.php
tests/Config/FiltersTest.php
Each change is a one-line fix per file. They should be batched in a single PR.
Activity