Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Backfill stripe payment currency

Dave Earleyb694049692e6
diff --git a/backend/database/migrations/2025_12_27_192118_backfill_stripe_payments_currency_from_orders.php b/backend/database/migrations/2025_12_27_192118_backfill_stripe_payments_currency_from_orders.php
new file mode 100644
index 000000000..5babc02f1
--- /dev/null
+++ b/backend/database/migrations/2025_12_27_192118_backfill_stripe_payments_currency_from_orders.php
@@ -0,0 +1,23 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\DB;
+
+return new class extends Migration
+{
+ public function up(): void
+ {
+ DB::statement(<<<SQL
+ UPDATE stripe_payments sp
+ SET currency = o.currency
+ FROM orders o
+ WHERE sp.order_id = o.id
+ AND sp.currency IS NULL
+ SQL);
+ }
+
+ public function down(): void
+ {
+ // Cannot reverse - we don't know which records had null currency before
+ }
+};