diff --git a/database/migrations/2024_03_23_135849_add_photo_column_to_nominee_table.php b/database/migrations/2024_03_23_135849_add_photo_column_to_nominee_table.php index 6ed0aca..846bb8e 100644 --- a/database/migrations/2024_03_23_135849_add_photo_column_to_nominee_table.php +++ b/database/migrations/2024_03_23_135849_add_photo_column_to_nominee_table.php @@ -3,6 +3,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Support\Facades\DB; class AddPhotoColumnToNomineeTable extends Migration { @@ -14,9 +15,16 @@ class AddPhotoColumnToNomineeTable extends Migration public function up() { Schema::table('nominee', function (Blueprint $table) { - $table->binary('photo')->nullable(); $table->dropColumn('image'); }); + + if (Schema::hasColumn('nominee', 'image_path')) { + Schema::table('nominee', function (Blueprint $table) { + $table->dropColumn('image_path'); + }); + } + + DB::statement("ALTER TABLE nominee ADD photo MEDIUMBLOB"); } /**