0
我正在使用Phinx在cakephp 3中編寫遷移腳本。 我需要在使用遷移更新表(使用update()命令)時添加包含主鍵的列。 但是,當我運行腳本時,它創建了列,但不包含主鍵。在更新cakephp上添加主鍵遷移的列cakephp
$table->addColumn('book_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true
])->addPrimaryKey('book_id');
$table->update();
感謝