ORIENT/tests/fixtures/plugins/database/tester/updates/create_posts_table.php

32 lines
988 B
PHP

<?php namespace Database\Tester\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class CreatePostsTable extends Migration
{
public function up()
{
Schema::create('database_tester_posts', function ($table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('title')->nullable();
$table->string('slug')->nullable()->index();
$table->text('long_slug')->nullable();
$table->text('description')->nullable();
$table->boolean('is_published')->default(false);
$table->timestamp('published_at')->nullable();
$table->integer('author_id')->unsigned()->index()->nullable();
$table->string('author_nickname')->default('October')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('database_tester_posts');
}
}