• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug ExecuteUpgradeQuery not used?

Affected version
2.0 RC3

W1zzard

Well-known member
#1
1010031-110b1.php, line 138, why doesn't this code use executeUpgradeQuery?

Underlying reason, I have to hook into executeUpgradeQuery to extract queries and run them manually on each Galera cluster node, to not hang the whole cluster.

More of those in the same file.

Code:
        // new conversation attachment permissions: insert for mods and admins only by default
        $db->query("
            INSERT IGNORE INTO xf_permission_entry
                (user_group_id, user_id, permission_group_id, permission_id, permission_value, permission_value_int)
            VALUES
                (3, 0, 'conversation', 'uploadAttachment', 'allow', 0),
                (4, 0, 'conversation', 'uploadAttachment', 'allow', 0)
        ");
 

Mike

XenForo developer
Staff member
#2
Any method of running a query is valid. executeUpgradeQuery is only for silencing certain types of errors that would otherwise stop the execution. That does not apply to this query.

You have a very particular use case which isn't one we're targeting (indeed, we're not targeting any extensions of the upgrade system), so you may need to consider a different approach, such as hooking into the query execution itself.
 

Chris D

XenForo developer
Staff member
#3
Especially seeing as the majority of the 2.x stuff will now be using the Schema Manager to execute queries rather than that method, or directly on the database adapter.