mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fix migrations.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'chart' => 'chartjs',
|
'chart' => 'chartjs',
|
||||||
'version' => '3.8.4',
|
'version' => '3.9.0',
|
||||||
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
||||||
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
||||||
'csv_import_enabled' => true,
|
'csv_import_enabled' => true,
|
||||||
|
@@ -5,9 +5,9 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChangesForV385
|
* Class ChangesForV390
|
||||||
*/
|
*/
|
||||||
class ChangesForV385 extends Migration
|
class ChangesForV390 extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
@@ -16,6 +16,14 @@ class ChangesForV385 extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down()
|
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();
|
$backup = $this->backupRepeatFreqsFromString();
|
||||||
|
|
||||||
// drop string and create enum field
|
// drop string and create enum field
|
||||||
@@ -48,15 +56,21 @@ class ChangesForV385 extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
// remove an index.
|
// // remove an index.
|
||||||
|
Schema::table(
|
||||||
|
'budget_limits', function (Blueprint $table) {
|
||||||
|
$table->dropForeign('bid_foreign');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Schema::table(
|
Schema::table(
|
||||||
'budget_limits', function (Blueprint $table) {
|
'budget_limits', function (Blueprint $table) {
|
||||||
$table->dropUnique('unique_limit');
|
$table->dropUnique('unique_limit');
|
||||||
$table->dropForeign('bid_foreign');
|
|
||||||
$table->dropUnique('unique_bl_combi');
|
$table->dropUnique('unique_bl_combi');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// recreate foreign key:
|
// recreate foreign key:
|
||||||
Schema::table(
|
Schema::table(
|
||||||
'budget_limits', function (Blueprint $table) {
|
'budget_limits', function (Blueprint $table) {
|
||||||
@@ -65,7 +79,6 @@ class ChangesForV385 extends Migration
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// backup values
|
// backup values
|
||||||
$backup = $this->backupRepeatFreqsFromEnum();
|
$backup = $this->backupRepeatFreqsFromEnum();
|
||||||
|
|
Reference in New Issue
Block a user