Код: Выделить всё
Schema::table('devices', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('client_id')->nullable();
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
});
Код: Выделить всё
Schema::table('devices', function (Blueprint $table) {
$table->dropForeign('devices_client_id_foreign');
$table->drop('devices');
});
Код: Выделить всё
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check that column/key exists (SQL:
Код: Выделить всё
In PDOStatement.php line 144:
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check that column/key exists
In PDOStatement.php line 142:
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'devices_client_id_foreign'; check that column/key exists
Подробнее здесь: https://stackoverflow.com/questions/518 ... -migration
Мобильная версия