From 5500ded3fb868dc7849a82811465576da1c9d55f Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Mon, 4 Nov 2024 20:02:21 +0100 Subject: [PATCH] added db constraint to ensure resource members are unique --- lib/Migration/Version000000Date20241025120000.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Migration/Version000000Date20241025120000.php b/lib/Migration/Version000000Date20241025120000.php index 1ed9a5b..3cbad8c 100644 --- a/lib/Migration/Version000000Date20241025120000.php +++ b/lib/Migration/Version000000Date20241025120000.php @@ -67,6 +67,7 @@ class Version000000Date20241025120000 extends SimpleMigrationStep { ['onDelete' => 'CASCADE'], 'organizationfolders_resource_members_resource_id_fk'); $table->addIndex(['resource_id'], 'organizationfolders_resource_members_resource_id_index'); + $table->addUniqueConstraint(['resource_id', 'type', 'principal'], "organizationfolders_resource_members_unique"); } return $schema;