From c3f354bb97011aeab28283de4c2e3705e8cf5835 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 17 Oct 2022 19:46:45 +0100 Subject: [PATCH 1/2] Drop unique index for flow measure identifiers In theory people can create flow measures months in advance, which mean duplicat e identifiers are possible. --- ...op_unique_index_on_flow_measures_table.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php diff --git a/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php b/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php new file mode 100644 index 00000000..eb9cacbd --- /dev/null +++ b/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php @@ -0,0 +1,35 @@ +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() + { + // + } +}; From fa00ef3a288b6ecb4a9fbe7a30a5be84cc5937ba Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 17 Oct 2022 19:50:16 +0100 Subject: [PATCH 2/2] fix: pint --- ...2_10_17_183844_drop_unique_index_on_flow_measures_table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php b/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php index eb9cacbd..0d178599 100644 --- a/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php +++ b/database/migrations/2022_10_17_183844_drop_unique_index_on_flow_measures_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. *