MINI Sh3ll
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCompanyDomainsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('company_domains', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('company_id')->nullable();
$table->string('domain_name')->unique()->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('company_domains', function (Blueprint $table) {
$table->dropForeign('company_domains_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
OHA YOOOO