mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for migration logic
This commit is contained in:
parent
9bafff7505
commit
7f97fc1bba
@ -20,6 +20,9 @@ class SubscriptionFactory
|
|||||||
$billing_subscription = new Subscription();
|
$billing_subscription = new Subscription();
|
||||||
$billing_subscription->company_id = $company_id;
|
$billing_subscription->company_id = $company_id;
|
||||||
$billing_subscription->user_id = $user_id;
|
$billing_subscription->user_id = $user_id;
|
||||||
|
$billing_subscription->steps = collect(\App\Livewire\BillingPortal\Purchase::$dependencies)
|
||||||
|
->pluck('id')
|
||||||
|
->implode(',');
|
||||||
|
|
||||||
return $billing_subscription;
|
return $billing_subscription;
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,21 @@ return new class extends Migration {
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('subscriptions', function (Blueprint $table) {
|
Schema::table('subscriptions', function (Blueprint $table) {
|
||||||
$steps = collect(Purchase::$dependencies)
|
$table->string('text')->nullable();
|
||||||
->pluck('id')
|
});
|
||||||
->implode(',');
|
|
||||||
|
$steps = collect(Purchase::$dependencies)
|
||||||
|
->pluck('id')
|
||||||
|
->implode(',');
|
||||||
|
|
||||||
|
\App\Models\Subscription::query()
|
||||||
|
->withTrashed()
|
||||||
|
->cursor()
|
||||||
|
->each(function ($subscription) use ($steps){
|
||||||
|
|
||||||
|
$subscription->steps = $steps;
|
||||||
|
$subscription->save();
|
||||||
|
|
||||||
$table->string('steps')->default($steps);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user