0
我正在使用Phinx在cakephp 3中编写迁移脚本。 我需要在使用迁移更新表(使用update()命令)时添加包含主键的列。 但是,当我运行脚本时,它创建了列,但不包含主键。在更新cakephp上添加主键迁移的列cakephp
$table->addColumn('book_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true
])->addPrimaryKey('book_id');
$table->update();
感谢