madbob/GASdottoNG

View on GitHub
code/database/migrations/2015_11_20_011524_create_categories_table.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

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

class CreateCategoriesTable extends Migration
{
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->string('id')->primary();
            $table->string('parent_id')->nullable();
            $table->timestamps();
            $table->string('name');
        });
    }

    public function down()
    {
        Schema::drop('categories');
    }
}