mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix migrations.
This commit is contained in:
@@ -5,9 +5,9 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
/**
|
||||
* Class ChangesForV385
|
||||
* Class ChangesForV390
|
||||
*/
|
||||
class ChangesForV385 extends Migration
|
||||
class ChangesForV390 extends Migration
|
||||
{
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
@@ -16,6 +16,14 @@ class ChangesForV385 extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
// restore removed unique index. Recreate it the correct way:
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->unique(['budget_id', 'startdate', 'repeat_freq'], 'unique_bl_combi');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$backup = $this->backupRepeatFreqsFromString();
|
||||
|
||||
// drop string and create enum field
|
||||
@@ -48,15 +56,21 @@ class ChangesForV385 extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// remove an index.
|
||||
// // remove an index.
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->dropForeign('bid_foreign');
|
||||
}
|
||||
);
|
||||
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
$table->dropUnique('unique_limit');
|
||||
$table->dropForeign('bid_foreign');
|
||||
$table->dropUnique('unique_bl_combi');
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// recreate foreign key:
|
||||
Schema::table(
|
||||
'budget_limits', function (Blueprint $table) {
|
||||
@@ -65,7 +79,6 @@ class ChangesForV385 extends Migration
|
||||
);
|
||||
|
||||
|
||||
|
||||
// backup values
|
||||
$backup = $this->backupRepeatFreqsFromEnum();
|
||||
|
Reference in New Issue
Block a user