-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Stripe subscription columns to teams tab
- Loading branch information
1 parent
14e5c2b
commit 7f262e8
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
database/migrations/2023_04_01_000000_add_stripe_subscription_columns_to_teams_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddStripeSubscriptionColumnsToTeamsTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('teams', function (Blueprint $table) { | ||
if (!Schema::hasColumn('teams', 'stripe_subscription_id')) { | ||
$table->string('stripe_subscription_id')->nullable()->after('name'); | ||
} | ||
if (!Schema::hasColumn('teams', 'stripe_status')) { | ||
$table->string('stripe_status')->nullable()->after('stripe_subscription_id'); | ||
} | ||
if (!Schema::hasColumn('teams', 'trial_ends_at')) { | ||
$table->timestamp('trial_ends_at')->nullable()->after('stripe_status'); | ||
} | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('teams', function (Blueprint $table) { | ||
$table->dropColumn(['stripe_subscription_id', 'stripe_status', 'trial_ends_at']); | ||
}); | ||
} | ||
} |