MINI Sh3ll
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePanelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('panels', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('company_id')->nullable();;
$table->string('api_type')->nullable();;
$table->string('chart_type')->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('panels', function (Blueprint $table) {
$table->dropForeign('panels_company_id_foreign');
$table->dropColumn('company_id');
});
}
}
OHA YOOOO