I have a column as tinyInteger. Now I would like to add comment to the column with new migration file.
Schema::table('sales_invoices', function (Blueprint $table) {
$table->tinyInteger('invoice_type')->comment('0 > A Normal Invoice, 1 > A Recurring Invoice');
});
Now above is the code I am trying in new schema to add comment, but it doesn't work and gives error.
If you want to change a column (and adding a comment to a column is also a change) you need to add the ->change() call on the end. And be sure you have the required package doctrine/dbal.
See: https://laravel.com/docs/5.7/migrations#modifying-columns
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community