getEnvironment() == "thetool") { $table = $this->table('WarehouseProjectJournal'); $table->addColumn('projectId', 'integer', ['signed' => false]) // Fixed: Matches unsigned ID ->addColumn('text', 'text', ['null' => true]) ->addColumn('data', 'json', ['null' => true, 'comment' => 'Stores changes/diffs']) ->addColumn('createBy', 'integer', ['signed' => false]) // Fixed: Best practice for User IDs ->addColumn('create', 'integer') ->addForeignKey('projectId', 'WarehouseProject', 'id', ['delete' => 'CASCADE', 'update' => 'CASCADE']) ->create(); } } }