Fixed the build by adding new migrations for each step.

This commit is contained in:
James Cole 2015-04-28 09:54:22 +02:00
parent da1bc18a47
commit 51ae130922
3 changed files with 72 additions and 13 deletions

View File

@ -33,18 +33,6 @@ class ChangesForV3310 extends Migration
} }
); );
Schema::table(
'transaction_groups', function (Blueprint $table) {
// drop column "relation"
$table->string('relation', 50);
}
);
// make new column "relation"
// set all current entries to be "balance"
DB::table('transaction_groups')->update(['relation' => 'balance']);
/* /*
* New table! * New table!
*/ */
@ -62,7 +50,6 @@ class ChangesForV3310 extends Migration
$table->decimal('longitude', 18, 12)->nullable(); $table->decimal('longitude', 18, 12)->nullable();
$table->smallInteger('zoomLevel', false, true)->nullable(); $table->smallInteger('zoomLevel', false, true)->nullable();
// connect reminders to users // connect reminders to users
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
} }

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3310a
*/
class ChangesForV3310a extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table(
'transaction_groups', function (Blueprint $table) {
// new column, relation.
$table->string('relation', 50)->nullable();
}
);
// make new column "relation"
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
/**
* Class ChangesForV3310b
*/
class ChangesForV3310b extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// set all current entries to be "balance"
DB::table('transaction_groups')->update(['relation' => 'balance']);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}