2019-06-14 18:41:21 0 Comments MySQL Boy.Lee

MySQL Reverse PK value

Say in MySQL Database, we have movie table with 1000 rows, id from 1 to 1000, now we want reverse the PK order set 1000 to 1, 1 to 1000, we can do it like this.

Yii 2 Migration create BigInt PK

Sometime we need create BigInt PK(Primary) coloum to replace the normal Int PK, in Yii 2.0's Migration tool, you can simple use the follow command to do the work.