mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateContactsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('contacts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->bigInteger('country_id')->unsigned()->nullable();
|
|
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
|
|
$table->bigInteger('company_id')->unsigned()->nullable();
|
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
|
$table->string('reference')->nullable();
|
|
$table->string('phone')->nullable();
|
|
$table->string('email')->nullable();
|
|
$table->string('wechat_id')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('contacts');
|
|
}
|
|
}
|