File: /home/xedaptot/be.naniguide.com/database/migrations/2016_07_06_145609_create_logs_table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLogsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('logs', function (Blueprint $table) {
$table->increments('id');
$table->integer('customer_id')->unsigned();
$table->string('type');
$table->string('name');
$table->text('data');
$table->timestamps();
// foreign
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('logs');
}
}