我想用我的控制器内的工匠迁移,这样Laravel 4 - 在控制器使用renameColumn
echo '<br>init migrate:install...';
Artisan::call('migrate');
echo 'done migrate:install';
它正常工作,为我所有表的创作等,但也有问题,当我尝试使用$ table-> renameColumn
Laravel doc说我需要包括doctrine/dbal,但是怎么样?我试过use Doctrine\DBAL\Driver\PDOMySql\Driver;
,但没有运气。
仅供参考我不能使用CLI,我的主机不提供任何CLI给我。
这是我的错误
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
UPDATE
同样的错误使用终端何时迁移
第二更新
An的迁移代码实施例在应用/ DA tabase /迁移
use Illuminate\Database\Migrations\Migration;
class UpdatePostsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user', function($table)
{
$table->renameColumn('fullname', 'full_name');
});
}
}
你是否能够在终端正常运行它? –
@DennisBraga不能。同样的错误,我收到。任何想法? –
发布您的移植代码,plz。 –