for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRedeemCodesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('redeem_codes', function(Blueprint $table) {
$table->increments('id');
$table->integer('event_id')->nullable();
$table->string('code', 12);
$table->boolean('reusable')->default(false);
$table->boolean('redeemed')->default(false);
$table->timestamps();
$table->index(['code']);
$table->foreign('event_id')->references('id')->on('events')->onDelete('cascade');
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('redeem_codes');