File: //var/www/quadcode/database/migrations/2023_07_13_093000_fields_for_waba_integration.php
<?php
use App\Models\PipedriveQueue;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class FieldsForWabaIntegration extends Migration
{
public function up()
{
Schema::table('pipedrive_queue', function (Blueprint $table) {
$table->string('whats_app_status')->default(PipedriveQueue::STATUS_NEW);
$table->string('lead_id')->nullable();
$table->timestamp('lead_created_at')->nullable();
$table->integer('step')->nullable();
});
PipedriveQueue::query()->update(['whats_app_status' => PipedriveQueue::STATUS_CANCEL]);
}
public function down()
{
Schema::table('pipedrive_queue', function (Blueprint $table) {
$table->dropColumn(['whats_app_status', 'lead_id', 'lead_created_at', 'step']);
});
}
}