From d8be6af27e9a682367608a3d36d9bd82209bf339 Mon Sep 17 00:00:00 2001 From: Martin Grossmann Date: Thu, 15 Feb 2024 14:54:23 +0100 Subject: [PATCH] [framework] added unique constraint to cart (#3017) --- src/Migrations/Version20240209114704.php | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Migrations/Version20240209114704.php diff --git a/src/Migrations/Version20240209114704.php b/src/Migrations/Version20240209114704.php new file mode 100644 index 0000000000..7f3e70d316 --- /dev/null +++ b/src/Migrations/Version20240209114704.php @@ -0,0 +1,27 @@ +sql('CREATE UNIQUE INDEX cart_identifier ON carts (cart_identifier) WHERE cart_identifier <> \'\';'); + $this->sql('CREATE UNIQUE INDEX customer_user_id ON carts (customer_user_id);'); + } + + /** + * @param \Doctrine\DBAL\Schema\Schema $schema + */ + public function down(Schema $schema): void + { + } +}