<?php
//Migrations acts as a version control for the database allowing you to modify the app's database schema

//allows use of necessary libraries
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateResourceExtension extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('resource_extensions', function (Blueprint $table) {
            $table->id();
            $table->string("extension", 60)->unique();
            $table->text("description");
            $table->timestamps();

            $table->foreignid("resource_category_id")->constrained("resource_categories", "id");
        });
    }

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