getTablePrefix(); DB::update("INSERT INTO {$prefix}schedules (name, message, scheduled_at, created_at, updated_at) SELECT name, message, scheduled_at, created_at, updated_at FROM {$prefix}incidents WHERE scheduled_at IS NOT NULL"); DB::table('incidents')->whereNotNull('scheduled_at')->delete(); Schema::table('incidents', function (Blueprint $table) { $table->dropColumn('scheduled_at'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('incidents', function (Blueprint $table) { $table->timestamp('scheduled_at')->before('created_at')->nullable()->default(null); }); } }