Adds incident visibility. Closes #602

This commit is contained in:
James Brooks
2015-05-20 08:41:02 +01:00
committed by James Brooks
parent 9257135641
commit df2ae7726d
9 changed files with 89 additions and 6 deletions

View File

@@ -36,6 +36,7 @@ $factory->define('CachetHQ\Cachet\Models\Incident', function ($faker) {
'name' => $faker->sentence(),
'message' => $faker->paragraph(),
'status' => 1,
'visible' => 1,
];
});

View File

@@ -0,0 +1,45 @@
<?php
/*
* This file is part of Cachet.
*
* (c) James Brooks <james@cachethq.io>
* (c) Joseph Cohen <joseph.cohen@dinkbit.com>
* (c) Graham Campbell <graham@mineuk.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableIncidentsAddVisibileColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
$table->boolean('visible')->after('status')->default(1);
$table->index('visible');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
$table->dropColumn('visible');
});
}
}