From b8e5caedbf02ce444acf26bcacb134c3461da62d Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 30 May 2025 10:25:24 +0700 Subject: [PATCH] [ticket/17509] Fix tests PHPBB-17509 --- phpBB/phpbb/db/tools/doctrine.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/tools/doctrine.php b/phpBB/phpbb/db/tools/doctrine.php index 63de0c8832..aaf44aed68 100644 --- a/phpBB/phpbb/db/tools/doctrine.php +++ b/phpBB/phpbb/db/tools/doctrine.php @@ -289,6 +289,12 @@ class doctrine implements tools_interface if (count($primary_key_indexes)) { + // For PostgreSQL, drop primary index first to avoid "Dependent objects still exist" error + if (stripos($this->get_schema_manager()->getDatabasePlatform()->getname(), 'postgresql') !== false) + { + $this->get_schema_manager()->dropIndex('"primary"', $table_name); + } + $ret = $this->alter_schema( function (Schema $schema) use ($table_name, $column_name): void { @@ -478,7 +484,7 @@ class doctrine implements tools_interface catch (Exception $e) { // @todo: check if it makes sense to properly handle the exception - return $e->getMessage(); + return [$e->getMessage()]; } }