made sl data authoritative and fixed some bugs and omissions
[openemr.git] / sql / 3_1_0-to-3_2_0_upgrade.sql
blob2561c7ddc5cd88301d1acc3f0e90e7cd64eabf1c
1 #IfMissingColumn users calendar
2 ALTER TABLE `users` 
3   ADD `calendar` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 = appears in calendar';
4 UPDATE users SET calendar = 1 WHERE authorized = 1 AND ( info IS NULL OR info NOT LIKE '%Nocalendar%' );
5 #EndIf
7 #IfNotRow2D list_options list_id lists option_id lbfnames
8 INSERT INTO list_options ( list_id, option_id, title, seq ) VALUES ('lists','lbfnames','Layout-Based Visit Forms',9);
9 #EndIf
11 #IfNotTable lbf_data
12 CREATE TABLE `lbf_data` (
13   `form_id`     int(11)      NOT NULL AUTO_INCREMENT COMMENT 'references forms.form_id',
14   `field_id`    varchar(31)  NOT NULL COMMENT 'references layout_options.field_id',
15   `field_value` varchar(255) NOT NULL,
16   PRIMARY KEY (`form_id`,`field_id`)
17 ) ENGINE=MyISAM COMMENT='contains all data from layout-based forms';
18 #EndIf
20 #IfMissingColumn form_encounter supervisor_id
21 ALTER TABLE `form_encounter` 
22   ADD `supervisor_id` INT(11) DEFAULT '0' COMMENT 'supervising provider, if any, for this visit';
23 #EndIf
25 #IfMissingColumn list_options mapping
26 ALTER TABLE `list_options` 
27   ADD `mapping` varchar(15) NOT NULL DEFAULT '';
28 #EndIf