File: /home/xedaptot/be.naniguide.com/database/migrations/2016_06_10_174524_create_customers_table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('customers')) {
return;
}
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->uuid('uid');
$table->integer('admin_id')->unsigned()->nullable();
$table->integer('contact_id')->unsigned()->nullable();
$table->integer('language_id')->unsigned()->nullable();
$table->string('timezone');
$table->string('status')->nullable();
$table->string('color_scheme')->nullable();
$table->binary('quota')->nullable();
$table->string('text_direction')->default('ltr');
$table->longText('payment_method')->nullable();
$table->longText('auto_billing_data')->nullable();
$table->string('menu_layout')->default('none');
$table->string('theme_mode')->default('light');
$table->string('custom_queue_name')->nullable();
$table->string('db_connection')->nullable();
$table->string('name')->nullable();
$table->timestamps();
// foreign
$table->foreign('admin_id')->references('id')->on('admins');
$table->foreign('contact_id')->references('id')->on('contacts');
$table->foreign('language_id')->references('id')->on('languages');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('customers');
}
}