mivita/database/migrations/2018_09_29_170559_create_accounts_table.php
2018-10-29 09:39:31 +01:00

73 lines
2.2 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('accounts', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id')->index();
$table->boolean('company')->default(true);
$table->string('company_name')->nullable()->index();
$table->string('company_street')->nullable();
$table->string('company_postal_code')->nullable();
$table->string('company_city')->nullable();
$table->unsignedInteger('company_pre_phone_id')->nullable();
$table->string('company_phone')->nullable();
$table->string('company_homepage')->nullable();
$table->unsignedInteger('company_country_id')->nullable()->index();
$table->char('salutation', 2)->nullable();
$table->string('title')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('street')->nullable();
$table->string('postal_code')->nullable();
$table->string('city')->nullable();
$table->unsignedInteger('country_id')->nullable()->index();
$table->unsignedInteger('pre_phone_id')->nullable();
$table->string('phone')->nullable();
$table->unsignedInteger('pre_mobil_id')->nullable();
$table->string('mobil')->nullable();
$table->date('birthday')->nullable();
$table->string('website')->nullable();
$table->string('facebook')->nullable();
$table->string('facebook_fanpage')->nullable();
$table->string('instagram')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('accounts');
}
}