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');