D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
forge
/
shaghela.online
/
database
/
migrations
/
Filename :
2021_07_28_000004_create_coupons_table.php
back
Copy
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCouponsTable extends Migration { /** * Schema table name to migrate * @var string */ public $tableName = 'coupons'; /** * Run the migrations. * @table coupons * * @return void */ public function up() { Schema::create($this->tableName, function (Blueprint $table) { $table->id(); $table->string('code')->nullable(); $table->string('discount_type')->nullable()->comment('percentage,fixed'); $table->double('discount')->nullable(); $table->tinyInteger('status')->nullable(); $table->dateTime('expire_date')->nullable(); $table->softDeletes(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists($this->tableName); } }