Commit 77f7d4a2 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix whatsapp_messages migration: drop FK constraints to missing tables

The demo_academy DB doesn't have organizations/users tables with those
exact names. Use plain indexed columns instead.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 468dd67e
...@@ -11,7 +11,7 @@ public function up(): void ...@@ -11,7 +11,7 @@ public function up(): void
{ {
Schema::create('whatsapp_messages', function (Blueprint $table) { Schema::create('whatsapp_messages', function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignId('academy_id')->constrained('organizations'); $table->unsignedBigInteger('academy_id')->index();
$table->string('wa_message_id')->nullable()->index(); $table->string('wa_message_id')->nullable()->index();
$table->string('phone_number', 20); $table->string('phone_number', 20);
$table->string('type', 30); $table->string('type', 30);
...@@ -20,7 +20,7 @@ public function up(): void ...@@ -20,7 +20,7 @@ public function up(): void
$table->text('error_message')->nullable(); $table->text('error_message')->nullable();
$table->jsonb('payload')->default('{}'); $table->jsonb('payload')->default('{}');
$table->jsonb('response')->default('{}'); $table->jsonb('response')->default('{}');
$table->foreignId('sent_by')->nullable()->constrained('users'); $table->unsignedBigInteger('sent_by')->nullable()->index();
$table->timestamp('sent_at')->nullable(); $table->timestamp('sent_at')->nullable();
$table->timestamp('delivered_at')->nullable(); $table->timestamp('delivered_at')->nullable();
$table->timestamp('read_at')->nullable(); $table->timestamp('read_at')->nullable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment