Skip to content

Firefly III: a personal finances manager

Cleanup rule migration.

James Cole44e76f951870
diff --git a/database/migrations/2016_01_11_193428_changes_for_v370.php b/database/migrations/2016_01_11_193428_changes_for_v370.php
index 542263f947..776113c508 100644
--- a/database/migrations/2016_01_11_193428_changes_for_v370.php
+++ b/database/migrations/2016_01_11_193428_changes_for_v370.php
@@ -52,11 +52,13 @@ class ChangesForV370 extends Migration
$table->integer('user_id')->unsigned();
$table->integer('rule_group_id')->unsigned();
$table->unsignedSmallInteger('order');
- $table->string('title', 255);
- $table->text('description');
$table->unsignedTinyInteger('active')->default(1);
$table->unsignedTinyInteger('stop_processing')->default(0);
+ $table->string('title', 255);
+ $table->text('description');
+
+
// connect rules to users
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
@@ -76,13 +78,13 @@ class ChangesForV370 extends Migration
$table->timestamps();
$table->integer('rule_id')->unsigned();
$table->unsignedSmallInteger('order');
- $table->string('title', 2048);
+ $table->unsignedTinyInteger('active')->default(1);
+ $table->unsignedTinyInteger('stop_processing')->default(0);
$table->string('trigger_type', 50);
$table->string('trigger_value', 255);
- $table->unsignedTinyInteger('active')->default(1);
- $table->unsignedTinyInteger('stop_processing')->default(0);
+
// order must be unique for rule triggers:
$table->unique(['rule_id', 'order']);
@@ -99,7 +101,6 @@ class ChangesForV370 extends Migration
$table->timestamps();
$table->integer('rule_id')->unsigned();
$table->unsignedSmallInteger('order');
-
$table->unsignedTinyInteger('active')->default(1);
$table->unsignedTinyInteger('stop_processing')->default(0);
@@ -107,6 +108,10 @@ class ChangesForV370 extends Migration
$table->string('action', 50);
$table->string('action_value', 255);
+
+
+
+
// connect rule actions to rules
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');