Skip to content

Firefly III: a personal finances manager

Migration for #508

James Colea442d3d952d8
diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php
index 45763acc4a..ad640bf06c 100644
--- a/database/migrations/2016_12_28_203205_changes_for_v431.php
+++ b/database/migrations/2016_12_28_203205_changes_for_v431.php
@@ -22,6 +22,27 @@ class ChangesForV431 extends Migration
*/
public function down()
{
+ // reinstate "repeats" and "repeat_freq".
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->string('repeat_freq', 30);
+ $table->boolean('repeats')->default(0);
+ }
+ );
+ // remove date field "end_date"
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->dropColumn('end_date');
+ }
+ );
+
+ // change field "start_date" to "startdate"
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->renameColumn('startdate', 'start_date');
+ }
+ );
+
}
/**
@@ -38,5 +59,27 @@ class ChangesForV431 extends Migration
}
);
+ // change field "startdate" to "start_date"
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->renameColumn('startdate', 'start_date');
+ }
+ );
+
+ // add date field "end_date" after "start_date"
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->date('end_date')->nullable()->after('start_date');
+ }
+ );
+
+ // drop "repeats" and "repeat_freq".
+ Schema::table(
+ 'budget_limits', function (Blueprint $table) {
+ $table->dropColumn('repeats');
+ $table->dropColumn('repeat_freq');
+ }
+ );
+
}
}