Advertisement:

Author Topic: Adding membergroups through SQL  (Read 2442 times)

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Adding membergroups through SQL
« on: August 03, 2014, 08:00:30 AM »
I want to add like 30 membergroups but I want to do it quickly through SQL since they will all have everything the same except for colour, group name/description/id, and badge.

Is there a way to do it? I was looking at the tables and it seems like it is going to be excruciating to do it that way cause of board perms and possibly other stuff I have overlooked.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring forum: Color Me Forum/Patreon.

Offline Justyne

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,399
Re: Adding membergroups through SQL
« Reply #1 on: August 03, 2014, 06:02:03 PM »
Dare I ask why you don't use "Set permissions like this group:" or "Apply pre-defined permission set (?):"

If you have to open each membergroup anyway to set the colour I doubt doing this in SQL is any faster.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Adding membergroups through SQL
« Reply #2 on: August 04, 2014, 01:31:31 AM »
I'd prefer Justyne advice. But, if you really wanna do it, first make a sample membergroup that you want. Then, backup sql for the relevant table and see how you can modify it so that you can import it back with the new 30 membergroups already added in it. It should be small and simple as it involves only an empty membergroup. Do it in a test forum and database of course before implementing in the real one. :)

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Adding membergroups through SQL
« Reply #3 on: August 04, 2014, 02:31:52 AM »
I did do it as inherit, but there's still 100000000 entries in the board permissions table for it :S.

I ended up doing it by hand, back button was a freaking life saver cause all the right boards were checked :D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring forum: Color Me Forum/Patreon.

Online Irisado

  • Doc Coordinator
  • SMF Hero
  • *
  • Posts: 9,022
  • Soñando debajo del arco iris
Re: Adding membergroups through SQL
« Reply #4 on: August 04, 2014, 07:37:46 AM »
Jade, could I just double check whether you're referring to MySQL or SQLite here.  I thought it was the latter initially, which is why I moved it here, but now I'm not so sure.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,062
    • Arantor on GitHub
Re: Adding membergroups through SQL
« Reply #5 on: August 04, 2014, 08:29:23 AM »
It's clearly MySQL not SQLite since that's phpMyAdmin.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Online Irisado

  • Doc Coordinator
  • SMF Hero
  • *
  • Posts: 9,022
  • Soñando debajo del arco iris
Re: Adding membergroups through SQL
« Reply #6 on: August 04, 2014, 12:06:31 PM »
Thanks.

Moved to coding discussion.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente