35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
Schema::create('contacts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('customer_id')->constrained()->onDelete('cascade');
|
|
$table->boolean('is_primary')->default(false);
|
|
$table->string('salutation', 20);
|
|
$table->string('academic_title', 20)->nullable();
|
|
$table->string('first_name', 50);
|
|
$table->string('last_name', 50);
|
|
$table->string('job_title', 100)->nullable();
|
|
$table->string('email', 100)->nullable();
|
|
$table->string('phone', 20)->nullable();
|
|
$table->string('mobile_phone', 20)->nullable();
|
|
$table->string('avatar')->nullable();
|
|
$table->json('online_accounts')->nullable();
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('contacts');
|
|
}
|
|
};
|