· 9 years ago · Jan 13, 2017, 03:56 AM
1drop table if exists `tblapproval`;
2create table `tblapproval` (
3 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
4 `project_id` int(11) NOT NULL,
5 `supervisor_username` varchar(255) NOT NULL,
6 `vote` varchar(4) DEFAULT NULL,
7 `note` text,
8 `responsible_for` varchar(500) NOT NULL DEFAULT '',
9 `supervisor_name` varchar(255) NOT NULL DEFAULT '',
10 PRIMARY KEY (`id`),
11 KEY `project_id` (`project_id`),
12 CONSTRAINT `tblapproval_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `tblproject` (`id_project`) ON DELETE CASCADE ON UPDATE CASCADE
13);
14
15drop table if exists tblemail;
16create table `tblemail` (
17 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
18 `data` text DEFAULT NULL COMMENT 'change to TEXT if mysql version <5.7',
19 `queue_status` varchar(1) NOT NULL DEFAULT 'q',
20 `sent` tinyint(1) NOT NULL DEFAULT '0',
21 `sent_ts` int(11) unsigned DEFAULT NULL,
22 `failed` tinyint(1) NOT NULL DEFAULT '0',
23 `created` int(11) unsigned NOT NULL,
24 `error` text,
25 `message` text DEFAULT NULL,
26 `status_changed` int(11) unsigned NOT NULL,
27 PRIMARY KEY (`id`)
28);
29
30alter table tblproject
31 modify column vote varchar(2) default null,
32 add column vote_changed timestamp default CURRENT_TIMESTAMP,
33 add column `archived` tinyint(1) unsigned not null default 0,
34 add column archived_ts int(11) unsigned DEFAULT NULL;
35
36 insert into tblsettings (name, value) values
37 ('notifications.vote_iv_to_members', 'IV Content'),
38 ('notifications.vote_v_to_members', 'V Content'),
39 ('notifications.vote_a_to_members', 'A Content'),
40 ('notifications.vote_p_to_team_members', 'P Content'),
41 ('notifications.activity_archived_to_owner', 'Archived Content'),
42 ('notifications.reminder_incomplete_activity', 'I Content'),
43 ('notifications.reminder_pending_activity', 'P Content'),
44 ('notifications.reminder_invalid_activity', 'IV Content'),
45 ('notifications.vote_iv_to_members_subject', 'IV Subject'),
46 ('notifications.vote_v_to_members_subject', 'V Subject'),
47 ('notifications.vote_a_to_members_subject', 'A Subject'),
48 ('notifications.vote_p_to_team_members_subject', 'P Subject'),
49 ('notifications.activity_archived_to_owner_subject', 'archived Subject'),
50 ('notifications.reminder_incomplete_activity_subject', 'reminder I Subject'),
51 ('notifications.reminder_pending_activity_subject', 'reminder P Subject'),
52 ('notifications.reminder_invalid_activity_subject', 'reminder IV Subject');