Skip to content

Commit

Permalink
Drop unique index for flow measure identifiers
Browse files Browse the repository at this point in the history
In theory people can create flow measures months in advance, which mean duplicat
e identifiers are possible.
  • Loading branch information
AndyTWF committed Oct 17, 2022
1 parent 6841d49 commit c3f354b
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('flow_measures', function (Blueprint $table) {
$indexes = Schema::getConnection()->getDoctrineSchemaManager()->listTableIndexes('flow_measures');
if (array_key_exists('flow_measures_identifier_unique', $indexes)) {
$table->dropUnique('flow_measures_identifier_unique');
}

$table->index('identifier');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};

0 comments on commit c3f354b

Please sign in to comment.