Migration Laravel将列更改为可空
我有一个已经创建了迁移的应用程序,现在我需要将一列更改为null。为此,我正在使用此新迁移:Migration Laravel将列更改为可空,migration,laravel-5.2,Migration,Laravel 5.2,我有一个已经创建了迁移的应用程序,现在我需要将一列更改为null。为此,我正在使用此新迁移: public function up() { Schema::table('Tablename', function ($table) { $table->string('nickname')->nullable()->change(); $table->text('message', 5000)->change();
public function up()
{
Schema::table('Tablename', function ($table) {
$table->string('nickname')->nullable()->change();
$table->text('message', 5000)->change();
});
}
运行迁移时,我遇到以下错误:
[Illuminate\Database\QueryException]
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "Tablename" does not exis
t (SQL: ALTER TABLE Wechat ALTER nickname DROP NOT NULL)
[PDOException]
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "tablename" does not exis
t
我使用postgres作为我的数据库,我使用的是laravel 5.2