IDはオイルスキャフォールドによって自動的に生成されるため、入力する必要はありません。そして、移行を実行した後、それは主キーとしてテーブルに作成されます。スキャフォールドの生成後に移行を変更する場合は、移行ファイル(fuel / app / migrations / ..)を編集できます。
あなたが例えば持っているなら
oil g scaffold test field:string field2:string
移行は次のようになります
namespace Fuel\Migrations;
class Create_tests
{
public function up()
{
\DBUtil::create_table('tests', array(
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),
'field' => array('constraint' => 255, 'type' => 'varchar'),
'field2' => array('constraint' => 255, 'type' => 'varchar'),
'created_at' => array('constraint' => 11, 'type' => 'int'),
'updated_at' => array('constraint' => 11, 'type' => 'int'),
), array('id'));
}
public function down()
{
\DBUtil::drop_table('tests');
}
}
お役に立てれば。