Validate database constraints (#9670)

* Validate database constraints

* Fix some differences with migrations

* Update functions.php
This commit is contained in:
Tony Murray
2019-01-17 08:59:42 -06:00
committed by GitHub
parent 9da12ee8af
commit 10f6eac677
5 changed files with 108 additions and 36 deletions

View File

@@ -14,7 +14,7 @@ class AddForeignKeysToSensorsToStateIndexesTable extends Migration
public function up()
{
Schema::table('sensors_to_state_indexes', function (Blueprint $table) {
$table->foreign('state_index_id', 'sensors_to_state_indexes_ibfk_2')->references('state_index_id')->on('state_indexes')->onUpdate('RESTRICT')->onDelete('RESTRICT');
$table->foreign('state_index_id', 'sensors_to_state_indexes_ibfk_1')->references('state_index_id')->on('state_indexes')->onUpdate('RESTRICT')->onDelete('RESTRICT');
$table->foreign('sensor_id')->references('sensor_id')->on('sensors')->onUpdate('RESTRICT')->onDelete('CASCADE');
});
}