PDA

View Full Version : When creating a mod which method is preferred?


John Lester
08-09-2012, 12:39 AM
When you're creating a mod that changes the users user group, and you have an option to revert that change later on, is it better to create a new table or to add a column to the existing table?

To clarify I'm working on a more complete unsubscribe mod, and I'm a bit stuck at the user group area. I want the admin to be able to choose if they want to change the users user group (easy enough), and if so which user group to change them to.

I'm wondering if it's better to create a new table "unsub_usergroup" to store the old usergroup info in, or create a new column in the usergroup table called "unsub_usergroup_id" and just change the users usergroupid (after copying the existing usergroupid to the new column).

I think it's safer to go with the new table so there's no conflict between the usergroupid column and the unsub_usergroup_id column.

kh99
08-12-2012, 01:43 PM
Yes, I think I'd create a new table, that way you don't have the overhead of a new column for each user when it will probably be used very rarely.