<?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->increments('id');
$table->integer('forum_id');
$table->string('title', 255);
$table->text('content');
$table->timestamps();
});
}
public function down()
{
Schema::drop('categories');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTopicsTable extends Migration {
public function up()
{
Schema::create('topics', function(Blueprint $table) {
$table->increments('id');
$table->integer('category_id');
$table->integer('user_id');
$table->string('title', 255);
$table->text('content');
$table->timestamps();
});
}
public function down()
{
Schema::drop('topics');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePostsTable extends Migration {
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->integer('topic_id');
$table->integer('user_id');
$table->text('content');
$table->timestamps();
});
}
public function down()
{
Schema::drop('posts');
}
}