Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SigalZ's avatar

Migration auto increment not bigint

Hello,

How can I create a table with auto increment, primary key, id that is not bigint but normal int?

0 likes
9 replies
SigalZ's avatar

@michaelsholadiran Sorry, I guess you did not understand my question, I'm trying to create a database table with migration.

michaelsholadiran's avatar

mysql database

just change the type of the field you want to increment to int(11) and check on the auto increment

SigalZ's avatar

@michaelsholadiran so, you can't make it auto-increment with the migration? And the primary key, will it make this field primary key or do I have to go and do it manually as well?

Please or to participate in this conversation.