1 #IfNotTable lang_constants
3 ## ########################################################
6 ## Table structure for table `lang_constants`
9 CREATE TABLE IF NOT EXISTS `lang_constants` (
10 `cons_id` int(11) NOT NULL auto_increment,
11 `constant_name` varchar(255) NOT NULL default '',
12 UNIQUE KEY `cons_id` (`cons_id`),
13 KEY `cons_name` (`constant_name`)
14 ) ENGINE=MyISAM AUTO_INCREMENT=6 ;
17 ## Dumping data for table `lang_constants`
20 ## ########################################################
23 ## Table structure for table `lang_definitions`
26 CREATE TABLE IF NOT EXISTS `lang_definitions` (
27 `def_id` int(11) NOT NULL auto_increment,
28 `cons_id` int(11) NOT NULL default '0',
29 `lang_id` int(11) NOT NULL default '0',
30 `definition` mediumtext NOT NULL,
31 UNIQUE KEY `def_id` (`def_id`),
32 KEY `definition` (`definition`(100))
36 ## Dumping data for table `lang_definitions`
40 ## ########################################################
43 ## Table structure for table `lang_languages`
46 CREATE TABLE IF NOT EXISTS `lang_languages` (
47 `lang_id` int(11) NOT NULL auto_increment,
48 `lang_code` char(2) NOT NULL default '',
49 `lang_description` varchar(100) NOT NULL default '',
50 UNIQUE KEY `lang_id` (`lang_id`)
54 ## Dumping data for table `lang_languages`
57 INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (1, 'en', 'English');
58 INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (2, 'se', 'Swedish');
59 INSERT INTO `lang_languages` (`lang_id`, `lang_code`, `lang_description`) VALUES (3, 'es', 'Spanish');
63 #IfMissingColumn lists outcome
65 ADD outcome int(11) NOT NULL DEFAULT 0,
66 ADD destination varchar(255) DEFAULT NULL;
69 #IfMissingColumn pnotes title
71 ADD title varchar(255) NOT NULL DEFAULT 'Unassigned',
72 ADD assigned_to varchar(255) NOT NULL DEFAULT '';
75 #IfMissingColumn users see_auth
76 ALTER TABLE users ADD see_auth int(11) NOT NULL DEFAULT 1;
77 UPDATE users SET see_auth = 3 WHERE authorized = 1;
81 CREATE TABLE `payments` (
82 `id` bigint(20) NOT NULL auto_increment,
83 `pid` bigint(20) NOT NULL DEFAULT 0,
84 `dtime` datetime NOT NULL,
85 `user` varchar(255) NOT NULL DEFAULT '',
86 `method` varchar(255) NOT NULL DEFAULT '',
87 `source` varchar(255) NOT NULL DEFAULT '',
88 `amount1` decimal(7,2) NOT NULL DEFAULT 0,
89 `amount2` decimal(7,2) NOT NULL DEFAULT 0,
90 `posted1` decimal(7,2) NOT NULL DEFAULT 0,
91 `posted2` decimal(7,2) NOT NULL DEFAULT 0,
96 #IfNotColumnType form_vitals temperature float(5,2)
97 ALTER TABLE form_vitals
98 MODIFY temperature float(5,2) default 0,
99 MODIFY pulse float(5,2) default 0,
100 MODIFY respiration float(5,2) default 0,
101 MODIFY waist_circ float(5,2) default 0;
104 #IfNotColumnType form_clinical_notes followup_required int(11)
105 ALTER TABLE form_clinical_notes
106 MODIFY followup_required int(11) NOT NULL DEFAULT 0;