FEATURE #1428: add migration for adding flag "is_homepage" to contents
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user