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

32 lines
988 B
PHP
Raw Normal View History

2015-09-09 09:28:47 +00:00
<?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) {
2015-09-09 09:28:47 +00:00
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('title')->nullable();
$table->string('slug')->nullable()->index();
$table->text('long_slug')->nullable();
2015-09-09 09:28:47 +00:00
$table->text('description')->nullable();
$table->boolean('is_published')->default(false);
$table->timestamp('published_at')->nullable();
$table->integer('author_id')->unsigned()->index()->nullable();
2016-01-25 04:39:46 +00:00
$table->string('author_nickname')->default('October')->nullable();
2015-09-18 19:36:58 +00:00
$table->softDeletes();
2015-09-09 09:28:47 +00:00
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('database_tester_posts');
}
}