Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
301fdb152a |
1 changed files with 3 additions and 4 deletions
|
|
@ -36,8 +36,9 @@ return new class extends Migration
|
||||||
$table->unsignedSmallInteger('http_status_code')->nullable();
|
$table->unsignedSmallInteger('http_status_code')->nullable();
|
||||||
|
|
||||||
// Related entities (for linking/audit)
|
// Related entities (for linking/audit)
|
||||||
$table->foreignId('order_id')->nullable()->constrained('orders')->nullOnDelete();
|
// No FK constraint — orders/subscriptions tables are created by the billing module
|
||||||
$table->foreignId('subscription_id')->nullable()->constrained('subscriptions')->nullOnDelete();
|
$table->unsignedBigInteger('order_id')->nullable()->index();
|
||||||
|
$table->unsignedBigInteger('subscription_id')->nullable()->index();
|
||||||
|
|
||||||
// Timestamps
|
// Timestamps
|
||||||
$table->timestamp('received_at');
|
$table->timestamp('received_at');
|
||||||
|
|
@ -51,8 +52,6 @@ return new class extends Migration
|
||||||
// Query indexes
|
// Query indexes
|
||||||
$table->index(['gateway', 'status', 'received_at']);
|
$table->index(['gateway', 'status', 'received_at']);
|
||||||
$table->index(['gateway', 'event_type']);
|
$table->index(['gateway', 'event_type']);
|
||||||
$table->index(['order_id']);
|
|
||||||
$table->index(['subscription_id']);
|
|
||||||
$table->index(['status', 'received_at']);
|
$table->index(['status', 'received_at']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue