<<<<<<< Updated upstream
INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `section`, `conferencetypes`, `conferences_id`, `year`) VALUES ( 'website', '', 'Global', 'text', '', '800', 'Your organization\'s website', 'conference', 'sciencefair,scienceolympics', '-1', '-1'), ( 'website_name', '', 'Global', 'text', '', '801', 'The name for your organization\'s website. This is only used if a website is entered.', 'conference', 'sciencefair,scienceolympics', '-1', '-1');
=======
-- Rename role columns, we know they're roles, we don't need a "role" prefix
ALTER TABLE `roles` CHANGE `roletype` `type` VARCHAR( 256 ) NOT NULL;
ALTER TABLE `roles` CHANGE `rolename` `name` VARCHAR( 256 ) NOT NULL;

-- Create space for remaining password info, will be migrated in the php script, deleted in the next db update
ALTER TABLE `accounts` ADD `passwordset` DATE NOT NULL AFTER `password`;
ALTER TABLE `accounts` ADD `oldpassword` VARCHAR( 64 ) NOT NULL AFTER `passwordset`;

-- The unique ID is now the accounts_id, call it that
ALTER TABLE `users` CHANGE `uid` `accounts_id` INT( 11 ) NOT NULL ;

-- Add comments to all the new user fields so we know which role they belong to in phpmyadmin (purely cosmetic)
ALTER TABLE `users` CHANGE `fairs_id` `fairs_id` INT(11) NOT NULL COMMENT 'fair';
ALTER TABLE `users` CHANGE `years_school` `years_school` TINYINT(4) NOT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `years_regional` `years_regional` TINYINT(4) NOT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `years_national` `years_national` TINYINT(4) NOT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `willing_chair` `willing_chair` ENUM('yes','no') NOT NULL DEFAULT 'no' COMMENT 'judge';
ALTER TABLE `users` CHANGE `special_award_only` `special_award_only` ENUM('yes','no') NOT NULL DEFAULT 'no' COMMENT 'judge';
ALTER TABLE `users` CHANGE `cat_prefs` `cat_prefs` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `div_prefs` `div_prefs` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `divsub_prefs` `divsub_prefs` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `languages` `languages` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `highest_psd` `highest_psd` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `expertise_other` `expertise_other` TINYTEXT NULL DEFAULT NULL COMMENT 'judge';
ALTER TABLE `users` CHANGE `sponsors_id` `sponsors_id` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'sponsor';
ALTER TABLE `users` CHANGE `primary` `primary` ENUM( 'no', 'yes' ) NULL DEFAULT NULL COMMENT 'sponsor';
ALTER TABLE `users` CHANGE `position` `position` VARCHAR( 64 ) NULL DEFAULT NULL COMMENT 'sponsor';
ALTER TABLE `users` CHANGE `notes` `notes` TEXT NULL DEFAULT NULL COMMENT 'sponsor';
ALTER TABLE `users` CHANGE `schools_id` `schools_id` INT( 11 ) NOT NULL COMMENT 'student';
ALTER TABLE `users` CHANGE `grade` `grade` INT( 11 ) NULL DEFAULT NULL COMMENT 'student';

-- Remove unneeded table, this linkage is in user_roles
DROP TABLE `users_conferences_link`;


>>>>>>> Stashed changes
