Skip to content

Commit cff3239

Browse files
authored
Merge pull request #977 from HiEventsDev/develop
2 parents 6cf2ba5 + b694049 commit cff3239

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\DB;
5+
6+
return new class extends Migration
7+
{
8+
public function up(): void
9+
{
10+
DB::statement(<<<SQL
11+
UPDATE stripe_payments sp
12+
SET currency = o.currency
13+
FROM orders o
14+
WHERE sp.order_id = o.id
15+
AND sp.currency IS NULL
16+
SQL);
17+
}
18+
19+
public function down(): void
20+
{
21+
// Cannot reverse - we don't know which records had null currency before
22+
}
23+
};

0 commit comments

Comments
 (0)