How can I add tiny integer column using laravel migration to MySQL? I thought this code
$table->addColumn('tinyInteger', 'birth_day', ['lenght' => 2]);
But it creates TINYINT(4) column. I don't know how I can solve this problem. Please don't ask me why a day only, not full date. It is a business logic of the app.
I solve my problem by pure sql
DB::statement("ALTER TABLE `users`
ADD `birth_day` TINYINT(2) DEFAULT NULL AFTER `lastname`");
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