【发布时间】:2017-01-26 20:35:47
【问题描述】:
我在一次迁移中创建了user_id 列:
public function up()
{
Schema::create($this->_tableName, function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id')->index();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
...
现在我尝试在第二次迁移中将此列设为可为空:
public function up()
{
Schema::table($this->_tableName, function(Blueprint $table) {
$table->unsignedInteger('user_id')->nullable()->change();
});
}
但我收到下一条消息:
$ php artisan migrate
[Doctrine\DBAL\DBALException]
Unknown database type _int4 requested, Doctrine\DBAL\Platforms\PostgreSqlPlatform may not support it.
怎么了?
【问题讨论】:
标签: php laravel laravel-5.2 database-migration