PDA

View Full Version : ALTERing vb_user table structure?!


Rouzbeh1
11-12-2006, 10:05 PM
hi,
i am making my first product for vB, so i need to have some additional fields in the user table.

ALTER TABLE `". TABLE_PREFIX ."user` ADD `canusesms` ENUM( 'yes', 'no', '1pd' ) NOT NULL DEFAULT 'no' ,
ADD `firstname` TEXT NOT NULL ,
ADD `lastname` TEXT NOT NULL ,
ADD `street` TEXT NOT NULL ,
ADD `zip` TEXT NOT NULL ,
ADD `city` TEXT NOT NULL ,
ADD `state` TEXT NOT NULL ,
ADD `country` TEXT NOT NULL ,
ADD `credits` VARCHAR( 255 ) NOT NULL DEFAULT '0',
ADD `mobile` VARCHAR( 25 ) NOT NULL ,
ADD `is_validated` char(1) default '0',
ADD `validation_code` text,
ADD `sentsms` varchar(255) default '0',
ADD `successfull_charges` varchar(255) default '0',
ADD `used_credits` varchar(255) NOT NULL default '0',
ADD `status` char(1) default '1',
ADD `signup_date` int(11) default '0',
ADD `last_login_ip` varchar(255) default NULL,
ADD `last_sms_ip` varchar(255) default NULL,
ADD `signup_ip` varchar(255) default NULL ;


is this a good solution to change the default users table structure or should i find another way to store these.....?

Zachery
11-12-2006, 11:03 PM
Hmm, I would seriously suggest if you plan to store all of that data in the user table to prefix it with a name.

like rouz_firstname etc, that way if Jelsoft every adds their own fields that are the same as yours theres no direct conflicts. You could also add a new table and store your own data.

Rouzbeh1
11-12-2006, 11:14 PM
which one is better?
would it cause conflicts with other plugins or Vbulletin itself, if i store them in vb_user?

PS: thanks for the tip on using prefix :D