Edit File: 2021_11_24_165655_create_subscriptions_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateSubscriptionsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('subscriptions', function (Blueprint $table) { $table->id(); $table->foreignId('plan_id')->nullable()->constrained()->references('id')->on('plans')->onDelete('set null'); $table->foreignId('user_id')->nullable()->constrained()->references('id')->on('users')->onDelete('set null'); $table->string('price')->nullable(); $table->string('duration')->nullable(); $table->enum('payment_type' , ['wallet' , 'online'])->nullable(); $table->enum('payment_status' , ['true' , 'false'])->default('false'); $table->enum('unsupscribe' , ['0' , '1'])->default('0'); $table->date('start_at')->nullable(); $table->date('end_at')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('subscriptions'); } }
Back to File Manager