28 lines
834 B
PHP
28 lines
834 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('subscriptions', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('planner_id')->constrained()->cascadeOnDelete();
|
|
$table->string('stripe_subscription_id')->unique();
|
|
$table->string('stripe_customer_id');
|
|
$table->string('status');
|
|
$table->string('plan');
|
|
$table->timestamp('trial_ends_at')->nullable();
|
|
$table->timestamp('ends_at')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('subscriptions');
|
|
}
|
|
};
|