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