Skip to content

Instantly share code, notes, and snippets.

@evercode1
Created February 11, 2017 20:39
Show Gist options
  • Save evercode1/fe7369a1cfeed380d9e1b874ef9d850d to your computer and use it in GitHub Desktop.
Save evercode1/fe7369a1cfeed380d9e1b874ef9d850d to your computer and use it in GitHub Desktop.
chapter 15 Lesson Migration
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLessonsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('lessons', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->unique();
$table->string('slug')->unique();
$table->integer('category_id')->unsigned();
$table->integer('subcategory_id')->unsigned();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('lessons');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment