![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/Corals/modules/Subscriptions/update-batches/ |
<?php try { if (\Schema::hasTable('subscriptions') && !\Schema::hasColumn('subscriptions', 'gateway')) { \Schema::table('subscriptions', function (\Illuminate\Database\Schema\Blueprint $table) { $table->text('gateway')->after('status')->nullable(); }); \Schema::table('subscriptions', function (\Illuminate\Database\Schema\Blueprint $table) { $table->longText('extras')->after('status')->nullable(); }); \Schema::table('invoices', function (\Illuminate\Database\Schema\Blueprint $table) { $table->longText('extras')->after('status')->nullable(); }); \Schema::table('plans', function (\Illuminate\Database\Schema\Blueprint $table) { $table->longText('extras')->after('status')->nullable(); }); \Schema::table('features', function (\Illuminate\Database\Schema\Blueprint $table) { $table->longText('extras')->after('status')->nullable(); }); \Schema::table('products', function (\Illuminate\Database\Schema\Blueprint $table) { $table->longText('products')->after('status')->nullable(); }); $subscriptions = \Corals\Modules\Subscriptions\Models\Subscription::all(); foreach ($subscriptions as $subscription) { $subscription->gateway = $subscription->user->gateway; $subscription->save(); } } } catch (\Exception $exception) { log_exception($exception); }