Created
February 11, 2017 20:39
-
-
Save evercode1/fe7369a1cfeed380d9e1b874ef9d850d to your computer and use it in GitHub Desktop.
chapter 15 Lesson Migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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