Last active
December 30, 2015 00:09
-
-
Save rohman/7748078 to your computer and use it in GitHub Desktop.
L4 Blog Migration Create Pages Table
This file contains 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\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreatePagesTable extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('pages', function(Blueprint $table) | |
{ | |
$table->increments('id'); | |
$table->string('title'); | |
$table->string('slug'); | |
$table->text('body')->nullable(); | |
$table->integer('user_id'); | |
$table->timestamps(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::drop('pages'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment