1 頁 (共 1 頁)

Database: Migrations Renaming Columns

發表於 : 2016-07-04 21:12:11
yehlu
https://laravel.com/docs/5.2/migrations ... ng-columns

代碼: 選擇全部

[Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
Renaming Columns

To rename a column, you may use the renameColumn method on the Schema builder. Before renaming a column, be sure to add the "doctrine/dbal" dependency to your composer.json file:

Schema::table('users', function ($table) {
$table->renameColumn('from', 'to');
});