From 3b39d1c6a7ff1fd68e0e497502ec315518d5c39d Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:16:09 +0200 Subject: [PATCH] TASK: Add unique index `currentContentStreamId` in `_workspace` table currently nothing prevents two workspaces having the same content stream --- .../src/DoctrineDbalContentGraphSchemaBuilder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php index 8afeadd811f..7314d88646f 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphSchemaBuilder.php @@ -118,6 +118,8 @@ private function createWorkspaceTable(): Table (new Column('status', self::type(Types::BINARY)))->setLength(20)->setNotnull(false), ]); + $workspaceTable->addUniqueIndex(['currentContentStreamId']); + return $workspaceTable->setPrimaryKey(['name']); }