We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am unable to drop columns from tables using $table->dropColumn();
$table->dropColumn();
I have tested this using a local and remote database and I keep getting the error shown in the screenshot below.
Create two migrations.
blogs
Schema::create('blogs', function (Blueprint $table) { $table->id(); $table->string('title'); $table->string('slug'); $table->text('description'); $table->text('content'); $table->string('image'); $table->timestamps(); });
Schema::table('blogs', function (Blueprint $table) { $table->dropColumn('description'); $table->dropColumn('content'); });
Perform the migration using php artisan migrate
php artisan migrate
1.0.13
8.3.12
11.27.2
macOS
No response
The text was updated successfully, but these errors were encountered:
I have this same issue
Sorry, something went wrong.
Update your package to latest release. I tested this schema and it's works!
Here is my schemas:
The first migration to create a blogs table with some columns
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('blogs', function (Blueprint $table) { $table->id(); $table->string('title'); $table->string('slug'); $table->text('description'); $table->text('content'); $table->string('image'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('blogs'); } };
Then another migration to drop some columns from the blogs table
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::table('blogs', function (Blueprint $table) { $table->dropColumn('description'); $table->dropColumn('content'); }); } /** * Reverse the migrations. */ public function down(): void { // Schema::dropIfExists('blogs'); } };
Sorry for late reply, give me feedback if error still occur.
No branches or pull requests
What happened?
I am unable to drop columns from tables using
$table->dropColumn();
I have tested this using a local and remote database and I keep getting the error shown in the screenshot below.
How to reproduce the bug
Create two migrations.
The first migration to create a
blogs
table with some columnsThen another migration to drop some columns from the
blogs
tablePerform the migration using
php artisan migrate
Package Version
1.0.13
PHP Version
8.3.12
Laravel Version
11.27.2
Which operating systems does with happen with?
macOS
Notes
No response
The text was updated successfully, but these errors were encountered: