Rename component.component to component_id with relationship name change

This commit is contained in:
James Brooks
2014-12-01 12:21:44 +00:00
parent 0ae06acac2
commit e0dd2ef909
2 changed files with 41 additions and 7 deletions
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableIncidentsRenameComponentColumn extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component` `component_id` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function(Blueprint $table)
{
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component` TINYINT(4) NOT NULL DEFAULT '1'");
});
}
}