FEATURE #1428: add migration for adding flag "is_homepage" to contents

This commit is contained in:
Michal Kváček
2016-02-15 16:54:08 +01:00
parent 9269d8c0b9
commit 36fc280f55
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddHomepageMark extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contents', function (Blueprint $table) {
$table->boolean('is_homepage')
->after('module_handler')
->default(false)
->comment('Is this content page the homepage?');
$table->index('is_homepage');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contents', function (Blueprint $table) {
$table->dropColumn('is_homepage');
});
}
}