File: /var/www/html/punjabcabs/database/migrations/2017_01_11_181558_create_promocodes_table.php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePromocodesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('promocodes', function (Blueprint $table) {
$table->increments('id');
$table->string('promo_code');
$table->float('discount',10, 2)->default(0);
$table->string('discount_type');
$table->string('user_type');
$table->integer('use_count');
$table->dateTime('starting_at');
$table->dateTime('expiration');
$table->enum('status', ['ADDED','EXPIRED']);
$table->string('description');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('promocodes');
}
}