mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
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:
co-authored by
Claude Opus 5.5
parent
2d2bf48003
commit
63153aa8b4
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user