Refactoring subscriptions

This commit is contained in:
David Bomba 2021-03-25 21:55:35 +11:00
parent 103fa1b974
commit 31eac0a761
2 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,15 @@ class RefactorBillingScriptionsTable extends Migration
{ {
Schema::rename('billing_subscriptions', 'subscriptions'); Schema::rename('billing_subscriptions', 'subscriptions');
Schema::table('subscriptions', function (Blueprint $table) {
$table->text('product_id')->change();
$table->text('recurring_product_ids');
});
Schema::table('subscriptions', function (Blueprint $table) {
$table->renameColumn('product_id', 'product_ids');
});
} }
/** /**

View File

@ -63,7 +63,7 @@ class SubscriptionApiTest extends TestCase
'X-API-TOKEN' => $this->token, 'X-API-TOKEN' => $this->token,
])->get('/api/v1/subscriptions/' . $this->encodePrimaryKey($billing_subscription->id)); ])->get('/api/v1/subscriptions/' . $this->encodePrimaryKey($billing_subscription->id));
nlog($response); // nlog($response);
$response->assertStatus(200); $response->assertStatus(200);
} }