Database: Migrations Renaming Columns

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Database: Migrations Renaming Columns

文章 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');
});
回覆文章

回到「laravel」