Edit File: 2021_07_27_152859_create_ads_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAdsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('ads', function (Blueprint $table) { $table->id(); $table->string('title')->nullable(); $table->text('content')->nullable(); $table->string('image')->nullable(); $table->foreignId('store_id')->nullable()->constrained()->onDelete('cascade'); $table->string('cover'); $table->string('profit')->nullable(); $table->enum('views' , ['true' , 'false'])->default('true'); $table->enum('status' , ['accepted' , 'reused' , 'pending'])->default('pending'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('ads'); } }
Back to File Manager