From 6a51b672c8b2a0952a07d3e1ae38952167ea9f71 Mon Sep 17 00:00:00 2001 From: Konstantinos Arvanitakis Date: Tue, 15 Sep 2026 21:40:35 +0300 Subject: [PATCH] Fix: Adding a check for hasTable --- ..._09_03_000001_create_stripe_payment_intents_table.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/database/migrations/2026_09_03_000001_create_stripe_payment_intents_table.php b/database/migrations/2026_09_03_000001_create_stripe_payment_intents_table.php index f0d9265..6f54166 100644 --- a/database/migrations/2026_09_03_000001_create_stripe_payment_intents_table.php +++ b/database/migrations/2026_09_03_000001_create_stripe_payment_intents_table.php @@ -12,11 +12,20 @@ use Lunar\Base\Migration; * package's own classes over this same table). Timestamped to run just * before this app's own add_context_to_stripe_payment_intents migration, * which already alters this table. + * + * Guarded with hasTable(): on any environment that already ran + * lunarphp/stripe's own copy of this migration before the package was + * removed, the table already exists — this migration is only the one that + * actually creates it on a fresh install/database from now on. */ return new class extends Migration { public function up(): void { + if (Schema::hasTable($this->prefix.'stripe_payment_intents')) { + return; + } + Schema::create($this->prefix.'stripe_payment_intents', function (Blueprint $table) { $table->id(); $table->foreignId('cart_id')->constrained($this->prefix.'carts');