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->foreignId('store_id')->nullable()->constrained()->references('id')->on('stores')->onDelete('set null'); $table->foreignId('ads_id')->nullable()->constrained()->references('id')->on('ads')->onDelete('set null'); $table->double('price')->nullable(); $table->double('expected_views')->nullable(); $table->double('real_views')->default(0); $table->enum('payment_type' , ['wallet' , 'online'])->nullable(); $table->enum('payment_status' , ['true' , 'false'])->default('false'); $table->date('start_at')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('subscriptions'); } }
Back to File Manager