HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/stafa/stafa.nl/database/migrations/2018_11_16_154518_create_components_table.php
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateComponentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('components', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('component_type_id'); //Does not refer to another tables column. Does refer to one of the ComponentTypes enum constants
            $table->unsignedInteger('component_area_id');
            $table->unsignedInteger('sort_order');
            $table->string('version');
            $table->mediumText('data');
            $table->timestamps();

            $table->foreign('component_area_id')->references('id')->on('component_areas');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('components');
        Schema::enableForeignKeyConstraints();
    }
}