Merge pull request #90 from cachethq/fix-migrations

Fix migrations
This commit is contained in:
James Brooks
2014-12-23 21:51:50 +00:00
2 changed files with 2 additions and 35 deletions

View File

@@ -14,7 +14,7 @@ class AlterTableIncidentsRenameComponentColumn extends Migration
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component` `component_id` TINYINT(4) NOT NULL DEFAULT '1'");
$table->rename('component', 'component_id');
});
}
@@ -26,7 +26,7 @@ class AlterTableIncidentsRenameComponentColumn extends Migration
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement("ALTER TABLE `incidents` CHANGE `component_id` `component` TINYINT(4) NOT NULL DEFAULT '1'");
$table->rename('component_id', 'component');
});
}
}

View File

@@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AlterIncidentsTableMoveUserIdColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `component_id`;');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
DB::statement('ALTER TABLE `incidents` MODIFY COLUMN `user_id` INT(10) UNSIGNED DEFAULT NULL AFTER `deleted_at`;');
});
}
}