2 -- Comment Meta Language Constructs:
5 -- argument: table_name
6 -- behavior: if the table_name does not exist, the block will be executed
9 -- argument: table_name
10 -- behavior: if the table_name does exist, the block will be executed
13 -- arguments: table_name colname
14 -- behavior: if the table exists but the column does not, the block will be executed
17 -- arguments: table_name colname value
18 -- behavior: If the table table_name does not have a column colname with a data type equal to value, then the block will be executed
21 -- arguments: table_name colname value
22 -- behavior: If the table table_name does not have a row where colname = value, the block will be executed.
25 -- arguments: table_name colname value colname2 value2
26 -- behavior: If the table table_name does not have a row where colname = value AND colname2 = value2, the block will be executed.
29 -- arguments: table_name colname value colname2 value2 colname3 value3
30 -- behavior: If the table table_name does not have a row where colname = value AND colname2 = value2 AND colname3 = value3, the block will be executed.
33 -- arguments: table_name colname value colname2 value2 colname3 value3 colname4 value4
34 -- behavior: If the table table_name does not have a row where colname = value AND colname2 = value2 AND colname3 = value3 AND colname4 = value4, the block will be executed.
37 -- desc: This is a very specialized function to allow adding items to the list_options table to avoid both redundant option_id and title in each element.
38 -- arguments: table_name colname value colname2 value2 colname3 value3
39 -- behavior: The block will be executed if both statements below are true:
40 -- 1) The table table_name does not have a row where colname = value AND colname2 = value2.
41 -- 2) The table table_name does not have a row where colname = value AND colname3 = value3.
44 -- arguments: table_name colname value colname2 value2
45 -- behavior: If the table table_name does have a row where colname = value AND colname2 = value2, the block will be executed.
48 -- desc: This function is most often used for dropping of indexes/keys.
49 -- arguments: table_name colname
50 -- behavior: If the table and index exist the relevant statements are executed, otherwise not.
53 -- desc: This function will allow adding of indexes/keys.
54 -- arguments: table_name colname
55 -- behavior: If the index does not exist, it will be created
58 -- all blocks are terminated with a #EndIf statement.
60 #IfNotTable report_results
61 CREATE TABLE `report_results` (
62 `report_id` bigint(20) NOT NULL,
63 `field_id` varchar(31) NOT NULL default '',
65 PRIMARY KEY (`report_id`,`field_id`)
69 #IfMissingColumn version v_acl
70 ALTER TABLE `version` ADD COLUMN `v_acl` int(11) NOT NULL DEFAULT 0;
73 #IfMissingColumn documents_legal_detail dld_moved
74 ALTER TABLE `documents_legal_detail` ADD COLUMN `dld_moved` tinyint(4) NOT NULL DEFAULT '0';
78 #IfMissingColumn documents_legal_detail dld_patient_comments
79 ALTER TABLE `documents_legal_detail` ADD COLUMN `dld_patient_comments` text COMMENT 'Patient comments stored here';
82 #IfMissingColumn documents_legal_master dlm_upload_type
83 ALTER TABLE `documents_legal_master` ADD COLUMN `dlm_upload_type` tinyint(4) DEFAULT '0' COMMENT '0-Provider Uploaded,1-Patient Uploaded';