Topic on Extension talk:ConfirmAccount

Error running updater.php with Postgres backend

2
174.71.94.45 (talkcontribs)

I'm reporting a bug here that I encountered while using ConfirmAccount with the Postgres backend. Running the updater fails with this error:

Adding column 'account_requests.acr_agent'
A database query error has occurred.
Query: ALTER TABLE account_requests ADD acr_agent /snip/mediawiki/extensions/ConfirmAccount/backend/schema/postgres/patch-acr_agent.sql
Function: DatabaseBase::query
Error: 42601 ERROR:  syntax error at or near "/"
LINE 1: ...e::query  */ TABLE account_requests ADD acr_agent /snip...
                                                             ^

Reason: the third parameter to addPgField should be the type, not a patch file. Since the patch file in this case is very simple, it can be replaced with a series of addPgField calls. Otherwise, it would have to be applied with a different function (addTable, maybe, though that's not what's really happening).

Solution: Apply this patch to extensions/ConfirmAccount/backend/schema/ConfirmAccountUpdater.hooks.php:

diff --git a/extensions/ConfirmAccount/backend/schema/ConfirmAccountUpdater.hooks.php b/extensions/ConfirmAccount/backend/schema/ConfirmAccountUpdater.hooks.php
index 54e6d31..d07dc54 100755
--- a/extensions/ConfirmAccount/backend/schema/ConfirmAccountUpdater.hooks.php
+++ b/extensions/ConfirmAccount/backend/schema/ConfirmAccountUpdater.hooks.php
@@ -34,7 +34,10 @@ class ConfirmAccountUpdaterHooks {
                        $updater->addExtensionUpdate( array( 'addPgField', 'account_requests', 'acr_areas', "TEXT" ) );
                        $updater->addExtensionUpdate( array( 'addPgField', 'account_credentials', 'acd_areas', "TEXT" ) );
                        $updater->addExtensionUpdate( array( 'addIndex', 'account_requests', 'acr_email', "$base/patch-email-index.sql", true ) );
-                       $updater->addExtensionUpdate( array( 'addPgField', 'account_requests', 'acr_agent', "$base/patch-acr_agent.sql", true ) );
+                       $updater->addExtensionUpdate( array( 'addPgField', 'account_requests', 'acr_xff', "TEXT" ) );
+                       $updater->addExtensionUpdate( array( 'addPgField', 'account_requests', 'acr_agent', "TEXT" ) );
+                       $updater->addExtensionUpdate( array( 'addPgField', 'account_credentials', 'acd_xff', "TEXT" ) );
+                       $updater->addExtensionUpdate( array( 'addPgField', 'account_credentials', 'acd_agent', "TEXT" ) );
                }
                return true;
        }
46.4.115.119 (talkcontribs)

I have a similar error.

When i want to run php update.php i get this error:

Adding column 'bs_namespacemanager_backup_page.page_content_model'

A database query error has occurred.

Query: ALTER TABLE bs_namespacemanager_backup_page ADD page_content_model /home/sysadmin/mediawiki-1.27.1/extensions/BlueSpiceExtensions/NamespaceManager/db/bs_namespacemanager_backup_page.patch.pg.sql

Function: DatabaseBase::query

Error: 42601 ERROR:  syntax error at or near "/"

LINE 1: ...mespacemanager_backup_page ADD page_content_model /home/sysa...

can anyone help me?

Reply to "Error running updater.php with Postgres backend"