I am using cakephp 3 migrations plugin to design database. I want to add a status
field tinyint
with limit as 1
to an field, I have tried the following but nothing adds up.
Attempt 1. (Fails)
$table->addColumn('status', 'smallinteger', [
'default' => 0,
'limit' => 1,
'null' => false,
]);
Attempt 2. (Fails)
$table->addColumn('status', 'tinyint', [
'default' => 0,
'limit' => 1,
'null' => false,
]);
I could not find any documentation for the same may be its there and i am missing something Docs Link
Adding field type of boolean adds tinyint column of length 1
$table
->addColumn('status', 'boolean', [
'default' => false,
'null' => false,
]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With