cfapress wrote on Wednesday, July 22, 2009:
The inclusion of the new database field, calendar, in the users table created something of a problem when I tested it. I found that none of my users had calendar access after running the sql_upgrade script.
Here are the two lines that do the upgrade:
ALTER TABLE `users` ADD `calendar` TINYINT(1) NOT NULL DEFAULT 0 COMMENT ‘1 = appears in calendar’
UPDATE users SET calendar = 1 WHERE authorized = 1 AND info NOT LIKE ‘%Nocalendar%’
Of my 150+ users only one met the criteria in the UPDATE statement. It has to do with the “AND info NOT LIKE ‘%Nocalendar%’”. You see, the value in the info field for users defaults to NULL. Which is not a value at all and thus the LIKE condition is considered false.
My suggestion is to set the default value of the new ‘calendar’ field to 1.
Then run this update query:
UPDATE users SET calendar = 0 WHERE authorized = 0 OR info LIKE ‘%Nocalendar%’
Jason