File: /home/armgroup/libs/database/migrations/2021_07_19_144451_create_attributes_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('attributes', function (Blueprint $table) {
$table->id();
$table->foreignId('group_id')->constrained('attribute_groups')->onUpdate('cascade')->onDelete('cascade');
$table->string('name');
$table->unsignedInteger('sort_order')->nullable()->default(null);
$table->boolean('highlight')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('attributes');
}
}