yii\db\Exception : SQLSTATE[HY000]: General error: 1 AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
Failed to prepare SQL: CREATE TABLE unsigned_pk (
id integer UNSIGNED PRIMARY KEY AUTOINCREMENT NOT NULL
)
Additional info
Q
A
Yii version
2.0.*
PHP version
*
Operating system
*
We could get away with it by setting it like this
public $typeMap = [
Schema::TYPE_PK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_UPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
// instead of Schema::TYPE_UPK => 'integer UNSIGNED PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_BIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_UBIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
// instead of Schema::TYPE_UBIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
// ...
];
OR by remowing AUTOINCREMENT from unsigned mappings but I'm not sure what is more important to keep for the developer.
What steps will reproduce the problem?
What is the expected result?
Table created.
What do you get instead?
Additional info
We could get away with it by setting it like this
OR by remowing AUTOINCREMENT from unsigned mappings but I'm not sure what is more important to keep for the developer.