2016-01-13 94 views
3

我想创建一个biginteger-主键迁移并将其切换到auto_increment。我使用robmorgans Phinx来创建迁移。Biginteger auto_increment主键Phinx

是否可以在创建数据类型BIGINTEGER后将表的主键更改为auto_incremented?

目前看起来像这样。

$positions = $this->table('positions', ['id' => false, 'primary_key' => 'id']) 
     ->changeColumn('id', 'biginteger', ['auto_increment' => true]) 
     ->addColumn('work_order_id', 'char', ['after' => 'vehicle_id','default' => null, 'null' => true,'limit' => 36]) 
     ->update(); 
+0

请添加一个实际的问题,你的问题 - 谢谢! – ndm

回答

相关问题