Cleanup rule migration.

This commit is contained in:
James Cole 2016-01-12 20:56:43 +01:00
parent f9703eca4c
commit 44e76f9518

View File

@ -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');