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()
|
|
|
|
|
{
|
2019-07-18 14:50:37 +00:00
|
|
|
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();
|
2016-02-20 06:15:58 +00:00
|
|
|
$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');
|
|
|
|
|
}
|
|
|
|
|
}
|