Migrations fixed for customers
This commit is contained in:
parent
1358a6a27d
commit
f119f95ed7
|
|
@ -17,12 +17,15 @@ class CreateCustomersTable extends Migration
|
|||
$table->increments('id');
|
||||
$table->string('first_name');
|
||||
$table->string('last_name');
|
||||
$table->string('email');
|
||||
$table->enum('gender', ['Male', 'Female']);
|
||||
$table->date('date_of_birth');
|
||||
$table->string('phone')->unique()->nullable();
|
||||
$table->string('email')->unique();
|
||||
$table->string('password');
|
||||
$table->integer('customer_group_id')->unsigned()->nullable();
|
||||
$table->integer('address_id')->unsigned()->nullable();
|
||||
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade');
|
||||
$table->foreign('address_id')->references('id')->on('customer_addresses')->onDelete('cascade');
|
||||
$table->boolean('subscribed_to_news_letter')->default(0);
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,14 @@ class CreateCustomerAddressesTable extends Migration
|
|||
{
|
||||
Schema::create('customer_addresses', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('street');
|
||||
$table->integer('customer_id')->unsigned();
|
||||
$table->foreign('customer_id')->references('id')->on('customers');
|
||||
$table->string('address1');
|
||||
$table->string('address2');
|
||||
$table->string('address2')->nullable();
|
||||
$table->string('country');
|
||||
$table->string('state');
|
||||
$table->string('city');
|
||||
$table->integer('pincode');
|
||||
$table->integer('postcode');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddRememberTokenInCustomersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('customers', function (Blueprint $table) {
|
||||
$table->rememberToken();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue