No announcement yet.

Database manipulation help needed.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Database manipulation help needed.

    I'm having a real brain fart here on a sql query.

    I'm importing a large IPB site to VB (using impex), and the customer has a bunch of usergroups that are not inheriting any permissions with the import. Basically the usergroups have no permissions whatsoever, so when I go to import the rest of the data, users are denied avatars and signatures due to their default permissions based on their usergroup.

    I'm trying to set certain fields with certain perimissions from the default settings for the registered users group, but not all fields, an example query that works fine is:
    UPDATE `vb_usergroup` set signaturepermissions = 237567 where usergroupid IN (11, 12, 15, 16, 17, 18, 19, 21)
    However I need to do that over about half of the columns in the vb_usergroup table and can't sacrifice the time to execute the individual queries manually. I need to be able to write one query that will select the appropriate column permissions on all the rows and apply them across all of the imported user groups so that I won't get failures on importing avatars and signatures on the users. I need to figure this out fast as I'm supposed to pull off this upgrade about 13 hours from now. While I can do the queries individually for each column, the time required to do this over the entire usergroup table will exceed the performance expectations on the upgrade. Besides, typing all that stuff out gets boring.

    If anybody can throw some bait my way, I'd apprecciate it.
    Last edited by bigwater; Fri 26th Mar '10, 12:35pm.
    Anybody who says "it can't be done" will usually be interrupted by somebody who is already doing it.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.