File: //home/xedaptot/ai.naniguide.com/database/migrations/2016_06_14_025716_create_fields_table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFieldsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('fields', function (Blueprint $table) {
$table->increments('id');
$table->uuid('uid');
$table->integer('mail_list_id')->unsigned();
$table->string('label');
$table->string('type');
$table->string('tag');
$table->string('default_value')->nullable();
$table->boolean('visible')->default(true);
$table->boolean('required')->default(false);
$table->boolean('is_email')->default(false);
$table->string('custom_field_name')->default('');
$table->timestamps();
// foreign
$table->foreign('mail_list_id')->references('id')->on('mail_lists')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('fields');
}
}