0

I tried to set as only biginter but it lost its autoincrement properties. So I tried adding auto-increment as well.

$table->changeColumn('id', 'biginteger', ['identity' => true])->update();

But it showed error.

PDOException: SQLSTATE[42704]: Undefined object: 7 ERROR: type "bigserial" does not exist

How is this possible for PostgreSQL?

1 Answers1

0

For MySQL this works in phinx 0.12

$table = $this->table('mytable', ['id' => false, 'primary_key' => 'id']);
$table->addColumn('id', 'biginteger', ['identity' => true, 'signed' => false])->create();
İlter Kağan Öcal
  • 3,530
  • 1
  • 17
  • 10