This is an inconsistency that triggers multiple issues along the road
Right now, not defining table primary key gets it added as "int unsigned".
But any integer added would be "signed", especially problematic for foreign keys, since those together with indexes (unique!) will cause DB errors.
So I propose that signed is false by default when the primary key is generated unsigned by default to match this
Example:
$this->table('comments')
->addColumn('user_id', 'integer', [
'default' => null,
'null' => true,
//'signed' => false, Should not be needed anymore unless someone needs a signed field here
])
should be
`id` int UNSIGNED NOT NULL,
`user_id` int UNSIGNED DEFAULT NULL,
When baking snapshots this also usually causes the
public bool $autoId = false;
and each primary key manually being added extra into the table definitions.
Also quite cumbersome and not DRY
This is an inconsistency that triggers multiple issues along the road
Right now, not defining table primary key gets it added as "int unsigned". But any integer added would be "signed", especially problematic for foreign keys, since those together with indexes (unique!) will cause DB errors.
So I propose that signed is false by default when the primary key is generated unsigned by default to match this
Example:
should be
When baking snapshots this also usually causes the
and each primary key manually being added extra into the table definitions. Also quite cumbersome and not DRY
This would probably also be resolved with it.