fix(cloud): rework unsubscribed team cleanup and account deletion (#12210)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-10-19 17:32:16 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 2d2bf48003
commit 63153aa8b4
30 changed files with 1918 additions and 253 deletions
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('subscriptions', function (Blueprint $table) {
$table->timestamp('ended_at')->nullable()->index()->after('stripe_refunded_at');
});
// updated_at is the best available estimate for rows that ended before this column existed.
DB::table('subscriptions')
->where('stripe_invoice_paid', false)
->where('stripe_past_due', false)
->update(['ended_at' => DB::raw('updated_at')]);
}
public function down(): void
{
Schema::table('subscriptions', function (Blueprint $table) {
$table->dropIndex(['ended_at']);
$table->dropColumn('ended_at');
});
}
};