Database stuff.

This commit is contained in:
James Cole
2016-04-25 11:44:41 +02:00
parent 51d97cdca5
commit b4f18dbe77
3 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangesFor385 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// remove an index.
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->dropUnique('unique_limit');
}
);
// create it again, correctly.
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->unique(['budget_id', 'startdate','repeat_freq'], 'unique_limit');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}