Migrations for incidents and components

This commit is contained in:
James Brooks
2014-11-16 22:54:17 +00:00
parent 61171582e2
commit 3c416efa7e
2 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIncidentsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('incidents', function(Blueprint $table)
{
$table->increments('id');
$table->tinyInteger('component')->default(1);
$table->string('name');
$table->tinyInteger('status', 1);
$table->longText('message');
$table->timestamps();
$table->softDeletes();
$table->index('component');
$table->index('status');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('incidents');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateComponentsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('components', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('description')->nullable()->default(null);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('components');
}
}