[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/setup/ -> changes.sql (source)

   1  DROP TABLE IF EXISTS eventum_project_round_robin;
   2  CREATE TABLE eventum_project_round_robin (
   3    prr_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
   4    prr_prj_id INT(11) UNSIGNED NOT NULL,
   5    prr_blackout_start TIME NOT NULL,
   6    prr_blackout_end TIME NOT NULL,
   7    PRIMARY KEY (prr_id),
   8    UNIQUE KEY prr_prj_id (prr_prj_id)
   9  );
  10  
  11  DROP TABLE IF EXISTS eventum_round_robin_user;
  12  CREATE TABLE eventum_round_robin_user (
  13    rru_prr_id INT(11) UNSIGNED NOT NULL,
  14    rru_usr_id INT(11) UNSIGNED NOT NULL,
  15    rru_next TINYINT(1) UNSIGNED NULL
  16  );
  17  
  18  ALTER TABLE eventum_support_email DROP COLUMN sup_draft_response;
  19  
  20  CREATE TABLE eventum_email_draft (
  21    emd_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  22    emd_usr_id INT(11) UNSIGNED NOT NULL,
  23    emd_iss_id INT(11) unsigned NOT NULL,
  24    emd_sup_id INT(11) UNSIGNED NULL DEFAULT NULL,
  25    emd_updated_date DATETIME NOT NULL,
  26    emd_subject VARCHAR(255) NOT NULL,
  27    emd_body LONGTEXT NOT NULL,
  28    PRIMARY KEY(emd_id)
  29  );
  30  
  31  CREATE TABLE eventum_email_draft_recipient (
  32    edr_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  33    edr_emd_id INT(11) UNSIGNED NOT NULL,
  34    edr_is_cc TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
  35    edr_email VARCHAR(255) NOT NULL,
  36    PRIMARY KEY(edr_id)
  37  );
  38  
  39  ALTER TABLE eventum_note ADD COLUMN not_blocked_message longtext NULL;
  40  
  41  # february 24
  42  
  43  ALTER TABLE eventum_email_account ADD COLUMN ema_get_only_new int(1) NOT NULL DEFAULT 0;
  44  ALTER TABLE eventum_email_account ADD COLUMN ema_leave_copy int(1) NOT NULL DEFAULT 0;
  45  
  46  # march 1
  47  
  48  ALTER TABLE eventum_news ADD COLUMN nws_status varchar(8) NOT NULL default 'active';
  49  
  50  ALTER TABLE eventum_note ADD COLUMN not_title varchar(255) NOT NULL;
  51  ALTER TABLE eventum_note ADD COLUMN not_parent_id int(11) unsigned NULL;
  52  
  53  # march 8
  54  
  55  ALTER TABLE eventum_reminder_level ADD COLUMN rem_rank TINYINT(1) NOT NULL;
  56  INSERT INTO eventum_reminder_field (rmf_title, rmf_sql_field, rmf_sql_representation) VALUES ('Category', 'iss_prc_id', 'iss_prc_id');
  57  ALTER TABLE eventum_issue ADD COLUMN iss_expected_resolution_date date default NULL;
  58  ALTER TABLE eventum_status ADD COLUMN sta_abbreviation char(3) NOT NULL;
  59  ALTER TABLE eventum_status ADD UNIQUE KEY sta_abbreviation (sta_abbreviation);
  60  
  61  # march 15
  62  
  63  DROP TABLE IF EXISTS eventum_reminder_action_list;
  64  CREATE TABLE eventum_reminder_action_list (
  65    ral_rma_id INT(11) UNSIGNED NOT NULL,
  66    ral_email VARCHAR(255) NOT NULL,
  67    ral_usr_id INT(11) UNSIGNED NOT NULL
  68  );
  69  
  70  INSERT INTO eventum_reminder_action_type (rmt_type, rmt_title) VALUES ('email_list', 'Send Email Alert To...');
  71  INSERT INTO eventum_reminder_action_type (rmt_type, rmt_title) VALUES ('sms_list', 'Send SMS Alert To...');
  72  
  73  DROP TABLE IF EXISTS eventum_irc_notice;
  74  CREATE TABLE eventum_irc_notice (
  75    ino_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  76    ino_prj_id INT(11) UNSIGNED NOT NULL,
  77    ino_created_date DATETIME NOT NULL,
  78    ino_message VARCHAR(255) NOT NULL,
  79    ino_status VARCHAR(8) NOT NULL DEFAULT 'pending',
  80    PRIMARY KEY(ino_id)
  81  );
  82  
  83  
  84  
  85  # April 8th, Issue #408, bryan
  86  ALTER TABLE eventum_email_draft ADD COLUMN emd_unknown_user VARCHAR(255) NULL DEFAULT NULL;
  87  
  88  ALTER TABLE eventum_note ADD COLUMN not_unknown_user VARCHAR(255) NULL DEFAULT NULL;
  89  
  90  ALTER TABLE eventum_issue_attachment ADD column iat_unknown_user varchar(255) NULL DEFAULT NULL;
  91  
  92  ALTER TABLE eventum_email_draft ADD COLUMN emd_updated_date DATETIME NOT NULL;
  93  
  94  # after cancun
  95  
  96  ALTER TABLE eventum_irc_notice ADD COLUMN ino_iss_id INT(11) UNSIGNED NOT NULL;
  97  ALTER TABLE eventum_irc_notice DROP COLUMN ino_prj_id;
  98  UPDATE eventum_irc_notice SET ino_iss_id=substring(ino_message, LOCATE('#', ino_message)+1, 4);
  99  
 100  
 101  CREATE TABLE eventum_issue_user_replier (
 102    iur_iss_id int(10) unsigned NOT NULL default '0',
 103    iur_usr_id int(10) unsigned NOT NULL default '0',
 104    PRIMARY KEY  (iur_iss_id,iur_usr_id),
 105    KEY iur_usr_id (iur_usr_id),
 106    KEY iur_iss_id (iur_iss_id)
 107  );
 108  
 109  ALTER TABLE eventum_custom_filter ADD COLUMN cst_show_authorized char(3) default '';
 110  ALTER TABLE eventum_custom_filter ADD COLUMN cst_show_notification_list char(3) default '';
 111  
 112  
 113  # Issue 158, weekly reports. This issue turned into changing the history system.
 114  # please run script misc/runonce/set_history_type.php after applying these changes.
 115  
 116  # lookup table for history type
 117  CREATE TABLE eventum_history_type (
 118      htt_id tinyint(2) unsigned NOT NULL auto_increment,
 119      htt_name varchar(25) NOT NULL,
 120      PRIMARY KEY(htt_id),
 121      UNIQUE (htt_name)
 122  );
 123  INSERT INTO eventum_history_type SET htt_name = 'attachment_removed';
 124  INSERT INTO eventum_history_type SET htt_name = 'attachment_added';
 125  INSERT INTO eventum_history_type SET htt_name = 'custom_field_updated';
 126  INSERT INTO eventum_history_type SET htt_name = 'draft_added';
 127  INSERT INTO eventum_history_type SET htt_name = 'draft_updated';
 128  INSERT INTO eventum_history_type SET htt_name = 'impact_analysis_added';
 129  INSERT INTO eventum_history_type SET htt_name = 'impact_analysis_updated';
 130  INSERT INTO eventum_history_type SET htt_name = 'impact_analysis_removed';
 131  INSERT INTO eventum_history_type SET htt_name = 'status_changed';
 132  INSERT INTO eventum_history_type SET htt_name = 'remote_locked';
 133  INSERT INTO eventum_history_type SET htt_name = 'remote_status_change';
 134  INSERT INTO eventum_history_type SET htt_name = 'remote_unlock';
 135  INSERT INTO eventum_history_type SET htt_name = 'remote_assigned';
 136  INSERT INTO eventum_history_type SET htt_name = 'remote_replier_added';
 137  INSERT INTO eventum_history_type SET htt_name = 'details_updated';
 138  INSERT INTO eventum_history_type SET htt_name = 'issue_opened';
 139  INSERT INTO eventum_history_type SET htt_name = 'issue_auto_assigned';
 140  INSERT INTO eventum_history_type SET htt_name = 'rr_issue_assigned';
 141  INSERT INTO eventum_history_type SET htt_name = 'issue_locked';
 142  INSERT INTO eventum_history_type SET htt_name = 'issue_unlocked';
 143  INSERT INTO eventum_history_type SET htt_name = 'duplicate_update';
 144  INSERT INTO eventum_history_type SET htt_name = 'duplicate_removed';
 145  INSERT INTO eventum_history_type SET htt_name = 'duplicate_added';
 146  INSERT INTO eventum_history_type SET htt_name = 'issue_opened_anon';
 147  INSERT INTO eventum_history_type SET htt_name = 'remote_issue_created';
 148  INSERT INTO eventum_history_type SET htt_name = 'issue_closed';
 149  INSERT INTO eventum_history_type SET htt_name = 'issue_updated';
 150  INSERT INTO eventum_history_type SET htt_name = 'user_associated';
 151  INSERT INTO eventum_history_type SET htt_name = 'user_all_unassociated';
 152  INSERT INTO eventum_history_type SET htt_name = 'replier_added';
 153  INSERT INTO eventum_history_type SET htt_name = 'remote_note_added';
 154  INSERT INTO eventum_history_type SET htt_name = 'note_added';
 155  INSERT INTO eventum_history_type SET htt_name = 'note_removed';
 156  INSERT INTO eventum_history_type SET htt_name = 'note_converted_draft';
 157  INSERT INTO eventum_history_type SET htt_name = 'note_converted_email';
 158  INSERT INTO eventum_history_type SET htt_name = 'notification_removed';
 159  INSERT INTO eventum_history_type SET htt_name = 'notification_added';
 160  INSERT INTO eventum_history_type SET htt_name = 'notification_updated';
 161  INSERT INTO eventum_history_type SET htt_name = 'phone_entry_added';
 162  INSERT INTO eventum_history_type SET htt_name = 'phone_entry_removed';
 163  INSERT INTO eventum_history_type SET htt_name = 'scm_checkin_removed';
 164  INSERT INTO eventum_history_type SET htt_name = 'email_associated';
 165  INSERT INTO eventum_history_type SET htt_name = 'email_disassociated';
 166  INSERT INTO eventum_history_type SET htt_name = 'email_sent';
 167  INSERT INTO eventum_history_type SET htt_name = 'time_added';
 168  INSERT INTO eventum_history_type SET htt_name = 'time_removed';
 169  INSERT INTO eventum_history_type SET htt_name = 'remote_time_added';
 170  INSERT INTO eventum_history_type SET htt_name = 'email_blocked';
 171  INSERT INTO eventum_history_type SET htt_name = 'email_routed';
 172  INSERT INTO eventum_history_type SET htt_name = 'note_routed';
 173  
 174  
 175  ALTER TABLE eventum_issue_history ADD COLUMN his_usr_id int(11) UNSIGNED NOT NULL AFTER his_iss_id;
 176  ALTER TABLE eventum_issue_history ADD COLUMN his_htt_id varchar(20) NOT NULL;
 177  
 178  
 179  
 180  
 181  
 182  # Allowing authorized repliers not be real users
 183  ALTER TABLE eventum_issue_user_replier DROP PRIMARY KEY;
 184  ALTER TABLE eventum_issue_user_replier ADD column iur_id int(11) unsigned NOT NULL auto_increment FIRST, ADD PRIMARY KEY(iur_id);
 185  ALTER TABLE eventum_issue_user_replier ADD COLUMN iur_email varchar(255) NULL;
 186  
 187  
 188  INSERT INTO eventum_history_type SET htt_name = 'replier_removed';
 189  INSERT INTO eventum_history_type SET htt_name = 'replier_other_added';
 190  
 191  # mail_queue changes
 192  CREATE TABLE eventum_mail_queue (
 193    maq_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 194    maq_queued_date DATETIME NOT NULL,
 195    maq_status VARCHAR(8) NOT NULL DEFAULT 'pending',
 196    maq_save_copy TINYINT(1) NOT NULL DEFAULT 1,
 197    maq_sender_ip_address VARCHAR(15) NOT NULL,
 198    maq_recipient VARCHAR(255) NOT NULL,
 199    maq_headers TEXT NOT NULL,
 200    maq_body LONGTEXT NOT NULL,
 201    KEY maq_status (maq_status),
 202    PRIMARY KEY(maq_id)
 203  );
 204  
 205  CREATE TABLE eventum_mail_queue_log (
 206    mql_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 207    mql_maq_id INT(11) UNSIGNED NOT NULL,
 208    mql_created_date DATETIME NOT NULL,
 209    mql_status VARCHAR(8) NOT NULL DEFAULT 'error',
 210    mql_server_message TEXT NULL,
 211    KEY mql_maq_id (mql_maq_id),
 212    PRIMARY KEY(mql_id)
 213  );
 214  
 215  INSERT INTO eventum_history_type SET htt_name = 'issue_associated';
 216  INSERT INTO eventum_history_type SET htt_name = 'issue_all_unassociated';
 217  
 218  # more weekly report related items
 219  ALTER TABLE eventum_issue_history ADD COLUMN his_is_hidden tinyint(1) NOT NULL DEFAULT 0;
 220  
 221  ALTER TABLE eventum_issue_user ADD COLUMN isu_assigned_date datetime;
 222  
 223  INSERT INTO eventum_history_type SET htt_name = 'user_unassociated';
 224  INSERT INTO eventum_history_type SET htt_name = 'issue_unassociated';
 225  
 226  # may 25
 227  
 228  ALTER TABLE eventum_issue ADD COLUMN iss_trigger_reminders tinyint(1) default 1;
 229  
 230  # june 2
 231  
 232  UPDATE eventum_user SET usr_email='system-account@example.com' WHERE usr_id=1;
 233  
 234  DROP TABLE IF EXISTS eventum_project_status_date;
 235  CREATE TABLE eventum_project_status_date (
 236    psd_id INT(11) UNSIGNED NOT NULL auto_increment,
 237    psd_prj_id INT(11) UNSIGNED NOT NULL,
 238    psd_sta_id INT(10) UNSIGNED NOT NULL,
 239    psd_date_field VARCHAR(64) NOT NULL,
 240    psd_label VARCHAR(32) NOT NULL,
 241    PRIMARY KEY (psd_id),
 242    UNIQUE KEY (psd_prj_id, psd_sta_id)
 243  );
 244  
 245  # june 7
 246  
 247  DROP TABLE IF EXISTS eventum_support_email_body;
 248  CREATE TABLE eventum_support_email_body (
 249    seb_sup_id int(11) unsigned NOT NULL,
 250    seb_body longtext NOT NULL,
 251    seb_full_email longtext NOT NULL,
 252    PRIMARY KEY (seb_sup_id)
 253  );
 254  INSERT INTO eventum_support_email_body (SELECT sup_id, sup_body, sup_full_email FROM eventum_support_email);
 255  # Run the next 2 lines ONLY after you have run the above line and check that eventum_support_email_body has the data correctly.
 256  # ALTER TABLE eventum_support_email DROP COLUMN sup_body;
 257  # ALTER TABLE eventum_support_email DROP COLUMN sup_full_email;
 258  
 259  # june 8
 260  ALTER TABLE eventum_support_email ADD COLUMN sup_usr_id int(11) unsigned DEFAULT NULL AFTER sup_iss_id;
 261  ALTER TABLE eventum_support_email ADD KEY sup_usr_id(sup_usr_id);
 262  
 263  # please run /misc/upgrade/v1.1_to_v1.2/set_support_email_usr_id.php
 264  
 265  ALTER TABLE eventum_email_account ADD COLUMN ema_issue_auto_creation varchar(8) NOT NULL DEFAULT 'disabled';
 266  ALTER TABLE eventum_email_account ADD COLUMN ema_issue_auto_creation_options text;
 267  
 268  
 269  
 270  
 271  # eventum 1.3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11111111111
 272  
 273  UPDATE eventum_user SET usr_role=usr_role+2 WHERE usr_role>3;
 274  UPDATE eventum_user SET usr_role=4 WHERE usr_role=3;
 275  
 276  ALTER TABLE eventum_project ADD COLUMN prj_customer_backend varchar(64) NULL;
 277  ALTER TABLE eventum_custom_filter ADD COLUMN cst_customer_email varchar(64) default NULL;
 278  ALTER TABLE eventum_issue ADD COLUMN iss_customer_id int(11) unsigned NULL;
 279  ALTER TABLE eventum_issue ADD COLUMN iss_customer_contact_id int(11) unsigned NULL;
 280  ALTER TABLE eventum_issue ADD COLUMN iss_last_customer_action_date datetime default NULL;
 281  ALTER TABLE eventum_support_email ADD COLUMN sup_customer_id int(11) unsigned NULL;
 282  
 283  ALTER TABLE eventum_user ADD COLUMN usr_customer_id int(11) unsigned NULL default NULL;
 284  ALTER TABLE eventum_user ADD COLUMN usr_customer_contact_id int(11) unsigned NULL default NULL;
 285  
 286  ALTER TABLE eventum_user ADD COLUMN usr_clocked_in tinyint(1) DEFAULT 0;
 287  
 288  DROP TABLE IF EXISTS eventum_customer_note;
 289  create table eventum_customer_note (
 290      cno_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 291      cno_prj_id int(11) unsigned NOT NULL,
 292      cno_customer_id INT(11) UNSIGNED NOT NULL,
 293      cno_created_date DATETIME NOT NULL,
 294      cno_updated_date DATETIME NULL,
 295      cno_note TEXT,
 296      primary key(cno_id),
 297      unique(cno_prj_id, cno_customer_id)
 298  );
 299  
 300  DROP TABLE IF EXISTS eventum_customer_account_manager;
 301  CREATE TABLE eventum_customer_account_manager (
 302    cam_id int(11) unsigned NOT NULL auto_increment,
 303    cam_prj_id int(11) unsigned NOT NULL,
 304    cam_customer_id int(11) unsigned NOT NULL,
 305    cam_usr_id int(11) unsigned NOT NULL,
 306    cam_type varchar(7) NOT NULL,
 307    PRIMARY KEY (cam_id),
 308    KEY cam_customer_id (cam_customer_id),
 309    UNIQUE KEY cam_manager (cam_prj_id, cam_customer_id, cam_usr_id)
 310  );
 311  
 312  
 313  ALTER TABLE eventum_project ADD COLUMN prj_workflow_backend varchar(64) NULL DEFAULT NULL;
 314  
 315  CREATE TABLE eventum_faq (
 316    faq_id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 317    faq_prj_id INT(11) UNSIGNED NOT NULL,
 318    faq_usr_id INT(11) UNSIGNED NOT NULL,
 319    faq_created_date DATETIME NOT NULL,
 320    faq_updated_date DATETIME NULL,
 321    faq_title VARCHAR(255) NOT NULL,
 322    faq_message LONGTEXT NOT NULL,
 323    PRIMARY KEY (faq_id),
 324    UNIQUE KEY faq_title (faq_title)
 325  );
 326  
 327  CREATE TABLE eventum_faq_support_level (
 328    fsl_faq_id INT(11) UNSIGNED NOT NULL,
 329    fsl_support_level_id INT(11) UNSIGNED NOT NULL,
 330    PRIMARY KEY (fsl_faq_id, fsl_support_level_id)
 331  );
 332  
 333  ALTER TABLE eventum_reminder_requirement ADD COLUMN rer_support_level_id INT(11) UNSIGNED NULL;
 334  ALTER TABLE eventum_reminder_requirement ADD COLUMN rer_customer_id INT(11) UNSIGNED NULL;
 335  
 336  CREATE TABLE eventum_project_field_display (
 337    pfd_prj_id int(11) unsigned NOT NULL,
 338    pfd_field varchar(20) NOT NULL,
 339    pfd_min_role tinyint(1) NOT NULL DEFAULT 0,
 340    PRIMARY KEY (pfd_prj_id, pfd_field)
 341  );
 342  
 343  
 344  
 345  
 346  
 347  # August 17
 348  CREATE TABLE eventum_issue_quarantine (
 349      iqu_iss_id int(11) unsigned auto_increment,
 350      iqu_expiration datetime NULL,
 351      iqu_status tinyint(1),
 352      PRIMARY KEY(iqu_iss_id),
 353      INDEX(iqu_expiration)
 354  );
 355  
 356  # august 18
 357  
 358  ALTER TABLE eventum_custom_filter ADD COLUMN cst_is_global int(1) default 0;
 359  
 360  # August 19th
 361  ALTER TABLE eventum_mail_queue ADD COLUMN maq_iss_id int(11) unsigned AFTER maq_id;
 362  ALTER TABLE eventum_mail_queue ADD COLUMN maq_subject varchar(255) NOT NULL AFTER maq_recipient;
 363  ALTER TABLE eventum_mail_queue ADD INDEX maq_iss_id (maq_iss_id);
 364  
 365  # August 23rd
 366  CREATE TABLE eventum_group (
 367      grp_id int(11) unsigned auto_increment,
 368      grp_name varchar(100) unique,
 369      grp_description varchar(255),
 370      grp_manager_usr_id int(11) unsigned,
 371      PRIMARY KEY(grp_id)
 372  );
 373  
 374  CREATE TABLE eventum_project_group (
 375      pgr_prj_id int(11)  unsigned,
 376      pgr_grp_id int(11) unsigned,
 377      index(pgr_prj_id),
 378      index(pgr_grp_id)
 379  );
 380  
 381  ALTER TABLE eventum_user ADD COLUMN usr_grp_id int(11) unsigned NULL default NULL AFTER usr_id;
 382  ALTER TABLE eventum_user ADD INDEX(usr_grp_id);
 383  
 384  ALTER TABLE eventum_issue ADD COLUMN iss_grp_id int(11) unsigned NULL default NULL AFTER iss_usr_id;
 385  ALTER TABLE eventum_issue ADD INDEX(iss_grp_id);
 386  
 387  INSERT INTO eventum_history_type SET htt_name = 'group_changed';
 388  
 389  
 390  # august 24th
 391  ALTER TABLE eventum_priority RENAME eventum_project_priority;
 392  ALTER TABLE eventum_project_priority CHANGE column pri_id pri_id tinyint(1) unsigned NOT NULL default '0' auto_increment;
 393  ALTER TABLE eventum_project_priority ADD COLUMN pri_prj_id int(11) unsigned NOT NULL;
 394  ALTER TABLE eventum_project_priority DROP PRIMARY KEY;
 395  ALTER TABLE eventum_project_priority ADD PRIMARY KEY(pri_id);
 396  ALTER TABLE eventum_project_priority DROP KEY pri_id;
 397  ALTER TABLE eventum_project_priority DROP KEY pri_id_2;
 398  ALTER TABLE eventum_project_priority ADD KEY(pri_title);
 399  ALTER TABLE eventum_project_priority ADD UNIQUE(pri_prj_id, pri_title);
 400  
 401  CREATE TABLE eventum_project_email_response (
 402    per_prj_id int(11) unsigned NOT NULL,
 403    per_ere_id int(10) unsigned NOT NULL,
 404    PRIMARY KEY (per_prj_id, per_ere_id)
 405  );
 406  
 407  
 408  CREATE TABLE eventum_project_phone_category (
 409    phc_id int(11) unsigned NOT NULL auto_increment,
 410    phc_prj_id int(11) unsigned NOT NULL default '0',
 411    phc_title varchar(64) NOT NULL default '',
 412    PRIMARY KEY  (phc_id),
 413    UNIQUE KEY uniq_category (phc_prj_id,phc_title),
 414    KEY phc_prj_id (phc_prj_id)
 415  );
 416  INSERT INTO eventum_project_phone_category (phc_id, phc_prj_id, phc_title) VALUES (1, 1, 'Sales Issues');
 417  INSERT INTO eventum_project_phone_category (phc_id, phc_prj_id, phc_title) VALUES (2, 1, 'Technical Issues');
 418  INSERT INTO eventum_project_phone_category (phc_id, phc_prj_id, phc_title) VALUES (3, 1, 'Administrative Issues');
 419  INSERT INTO eventum_project_phone_category (phc_id, phc_prj_id, phc_title) VALUES (4, 1, 'Other');
 420  
 421  ALTER TABLE eventum_phone_support ADD COLUMN phs_phc_id int(11) unsigned NOT NULL;
 422  
 423  # fix old values
 424  UPDATE eventum_phone_support SET phs_phc_id=1 WHERE phs_reason='sales';
 425  UPDATE eventum_phone_support SET phs_phc_id=2 WHERE phs_reason='technical';
 426  UPDATE eventum_phone_support SET phs_phc_id=3 WHERE phs_reason='administrative';
 427  UPDATE eventum_phone_support SET phs_phc_id=4 WHERE phs_reason='other';
 428  
 429  # check if everything is correct
 430  # SELECT DISTINCT phs_reason, COUNT(*) total FROM eventum_phone_support GROUP BY phs_reason;
 431  ALTER TABLE eventum_phone_support DROP COLUMN phs_reason;
 432  
 433  ALTER TABLE eventum_reminder_action ADD COLUMN rma_alert_irc TINYINT(1) unsigned NOT NULL DEFAULT 0;
 434  
 435  
 436  # August 31st
 437  ALTER TABLE eventum_issue ADD COLUMN iss_last_public_action_date datetime NULL;
 438  ALTER TABLE eventum_issue ADD COLUMN iss_last_public_action_type varchar(20) NULL;
 439  ALTER TABLE eventum_issue ADD COLUMN iss_last_internal_action_date datetime NULL;
 440  ALTER TABLE eventum_issue ADD COLUMN iss_last_internal_action_type varchar(20) NULL;
 441  
 442  ALTER TABLE eventum_reminder_action ADD COLUMN rma_alert_group_leader TINYINT(1) unsigned NOT NULL DEFAULT 0;
 443  
 444  
 445  # september 2nd
 446  ALTER TABLE eventum_project_user DROP KEY pru_prj_id;
 447  ALTER TABLE eventum_project_user ADD UNIQUE KEY pru_prj_id (pru_prj_id,pru_usr_id);
 448  
 449  
 450  # september 3rd
 451  ALTER TABLE eventum_history_type ADD COLUMN htt_role tinyint(1) DEFAULT '0';
 452  UPDATE eventum_history_type SET htt_role = 4 WHERE htt_name IN('note_added', 'note_removed', 'note_converted_draft',
 453      'note_converted_email', 'phone_entry_added', 'phone_entry_removed', 'time_added', 'time_removed',
 454      'remote_time_added', 'email_blocked', 'note_routed', 'group_changed', 'draft_added', 'draft_updated');
 455  INSERT INTO eventum_history_type SET htt_name = 'status_auto_changed', htt_role = 4;
 456  
 457  
 458  CREATE TABLE eventum_reminder_triggered_action (
 459    rta_iss_id int(11) unsigned not null,
 460    rta_rma_id int(11) unsigned not null,
 461    PRIMARY KEY (rta_iss_id)
 462  );
 463  
 464  # september 24th
 465  INSERT INTO eventum_history_type SET htt_name = 'issue_quarantine_removed', htt_role = 4;
 466  
 467  ALTER TABLE eventum_issue DROP COLUMN iss_lock_usr_id;
 468  
 469  # september 28th
 470  DROP TABLE IF EXISTS eventum_link_filter;
 471  CREATE TABLE eventum_link_filter (
 472    lfi_id int(11) unsigned NOT NULL auto_increment,
 473    lfi_pattern varchar(255) NOT NULL,
 474    lfi_replacement varchar(255) NOT NULL,
 475    lfi_usr_role tinyint(9) NOT NULL DEFAULT 0,
 476    lfi_description varchar(255) NULL,
 477    PRIMARY KEY  (lfi_id)
 478  );
 479  
 480  DROP TABLE IF EXISTS eventum_project_link_filter;
 481  CREATE TABLE eventum_project_link_filter (
 482    plf_prj_id int(11) NOT NULL,
 483    plf_lfi_id int(11) NOT NULL,
 484    PRIMARY KEY  (plf_prj_id, plf_lfi_id)
 485  );
 486  
 487  # October 4th
 488  ALTER TABLE eventum_irc_notice ADD COLUMN ino_prj_id int(11) NOT NULL;
 489  
 490  # October 7th
 491  ALTER TABLE eventum_reminder_field ADD column rmf_allow_column_compare tinyint(1) DEFAULT 0;
 492  UPDATE eventum_reminder_field SET rmf_allow_column_compare = 1 WHERE rmf_title LIKE '%date%';
 493  ALTER TABLE eventum_reminder_level_condition ADD COLUMN rlc_comparison_rmf_id tinyint(3) unsigned;
 494  
 495  # October 14th
 496  ALTER TABLE eventum_reminder_level ADD COLUMN rem_skip_weekend tinyint(1) NOT NULL DEFAULT 0;
 497  
 498  # October 18th
 499  ALTER TABLE eventum_custom_field ADD COLUMN fld_list_display tinyint(1) NOT NULL DEFAULT 0;
 500  
 501  # October 22nd
 502  INSERT INTO eventum_history_type SET htt_name = 'draft_routed', htt_role = 4;
 503  
 504  # November 8th
 505  DROP TABLE IF EXISTS eventum_columns_to_display;
 506  CREATE TABLE eventum_columns_to_display (
 507      ctd_prj_id int(11) unsigned NOT NULL,
 508      ctd_page varchar(20) NOT NULL,
 509      ctd_field varchar(30) NOT NULL,
 510      ctd_min_role tinyint(1) NOT NULL DEFAULT 0,
 511      ctd_rank tinyint(2) NOT NULL DEFAULT 0,
 512      PRIMARY KEY(ctd_prj_id, ctd_page, ctd_field),
 513      INDEX(ctd_prj_id, ctd_page)
 514  );
 515  
 516  
 517  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_pri_id',1,1);
 518  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_id',1,2);
 519  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_grp_id',1,3);
 520  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','assigned',1,4);
 521  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','time_spent',1,5);
 522  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','prc_title',1,6);
 523  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','pre_title',1,7);
 524  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_customer_id',1,8);
 525  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_sta_id',1,9);
 526  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','sta_change_date',1,10);
 527  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','last_action_date',1,11);
 528  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','custom_fields',1,12);
 529  INSERT INTO eventum_columns_to_display VALUES (1,'list_issues','iss_summary',1,13);
 530  
 531  # November 24
 532  INSERT INTO eventum_history_type (htt_name, htt_role) VALUES ('incident_redeemed', 4);
 533  INSERT INTO eventum_history_type (htt_name, htt_role) VALUES ('incident_unredeemed', 4);
 534  
 535  
 536  # December 4th
 537  
 538  
 539  # December 4th
 540  ALTER TABLE eventum_custom_filter ADD COLUMN cst_created_date_time_period smallint(4) AFTER cst_created_date_filter_type;
 541  ALTER TABLE eventum_custom_filter ADD COLUMN cst_updated_date_time_period smallint(4) AFTER cst_updated_date_filter_type;
 542  ALTER TABLE eventum_custom_filter ADD COLUMN cst_last_response_date_time_period smallint(4) AFTER cst_last_response_date_filter_type;
 543  ALTER TABLE eventum_custom_filter ADD COLUMN cst_first_response_date_time_period smallint(4) AFTER cst_first_response_date_filter_type;
 544  ALTER TABLE eventum_custom_filter ADD COLUMN cst_closed_date_time_period smallint(4) AFTER cst_closed_date_filter_type;
 545  
 546  # December 28th
 547  UPDATE eventum_user SET usr_status = 'inactive' WHERE usr_id = 1;
 548  
 549  
 550  
 551  # January 6th
 552  ALTER TABLE eventum_project_user ADD COLUMN pru_role tinyint(1) unsigned default 1;
 553  
 554  ALTER TABLE eventum_user DROP column usr_role;
 555  
 556  # January 23th
 557  ALTER TABLE eventum_email_draft ADD COLUMN emd_status enum('pending', 'edited', 'sent') NOT NULL DEFAULT 'pending' AFTER emd_sup_id;
 558  
 559  # January 26th
 560  ALTER TABLE eventum_project ADD COLUMN prj_segregate_reporter tinyint(1) DEFAULT 0;
 561  
 562  ALTER TABLE eventum_issue ADD COLUMN iss_private tinyint(1) NOT NULL DEFAULT 0;
 563  
 564  # February 16th
 565  UPDATE eventum_reminder_field SET rmf_allow_column_compare = 0 WHERE rmf_title='Status';
 566  
 567  INSERT INTO eventum_history_type (htt_id, htt_name, htt_role) VALUES (NULL, 'scm_checkin_associated', 0);
 568  
 569  ALTER TABLE eventum_project_priority ADD COLUMN pri_rank TINYINT(1) NOT NULL;
 570  UPDATE eventum_columns_to_display SET ctd_field='pri_rank' WHERE ctd_field='iss_pri_id';
 571  
 572  
 573  # February 28th
 574  ALTER TABLE eventum_mail_queue ADD COLUMN maq_type varchar(30) DEFAULT '';
 575  ALTER TABLE eventum_mail_queue ADD COLUMN maq_usr_id int(11) unsigned NULL DEFAULT NULL;
 576  
 577  # March 3rd
 578  CREATE TABLE eventum_search_profile (
 579    sep_id int(11) unsigned NOT NULL auto_increment,
 580    sep_usr_id int(11) unsigned NOT NULL,
 581    sep_prj_id int(11) unsigned NOT NULL,
 582    sep_type char(5) NOT NULL,
 583    sep_user_profile blob NOT NULL,
 584    PRIMARY KEY (sep_id),
 585    UNIQUE (sep_usr_id, sep_prj_id, sep_type)
 586  );
 587  
 588  # March 3rd
 589  ALTER TABLE eventum_issue ADD INDEX (iss_duplicated_iss_id);
 590  ALTER TABLE eventum_time_tracking ADD INDEX (ttr_iss_id)
 591  
 592  
 593  # March 7th
 594  ALTER TABLE eventum_issue ADD COLUMN iss_percent_complete tinyint(3) unsigned DEFAULT 0;
 595  
 596  # March 17th
 597  ALTER TABLE eventum_email_account ADD column ema_use_routing tinyint(1) DEFAULT 0;
 598  
 599  # April 20th
 600  UPDATE eventum_columns_to_display SET ctd_field='sta_rank' WHERE ctd_field='iss_sta_id';
 601  
 602  
 603  # May 23rd - FULL TEXT
 604  CREATE FULLTEXT INDEX ft_issue ON eventum_issue (iss_summary, iss_description);
 605  CREATE FULLTEXT INDEX ft_support_email ON eventum_support_email_body (seb_body);
 606  CREATE FULLTEXT INDEX ft_note ON eventum_note (not_title,not_note);
 607  CREATE FULLTEXT INDEX ft_time_tracking ON eventum_time_tracking (ttr_summary);
 608  CREATE FULLTEXT INDEX ft_phone_support ON eventum_phone_support (phs_description);
 609  
 610  ALTER TABLE eventum_time_tracking ADD INDEX ttr_iss_id(ttr_iss_id);
 611  
 612  # July 27th - Custom field changes
 613  ALTER TABLE eventum_custom_filter ADD COLUMN cst_custom_field TEXT;
 614  ALTER TABLE eventum_custom_field ADD COLUMN fld_min_role tinyint(1) NOT NULL DEFAULT 0;
 615  ALTER TABLE eventum_custom_field ADD COLUMN fld_rank smallint(2) NOT NULL DEFAULT 0;
 616  ALTER TABLE eventum_custom_field ADD COLUMN fld_backend varchar(100);
 617  
 618  ALTER TABLE eventum_custom_filter ADD COLUMN cst_search_type varchar(15) not null default 'customer';
 619  
 620  
 621  CREATE FULLTEXT INDEX ft_icf_value ON eventum_issue_custom_field (icf_value);
 622  
 623  # July 28th - Adding reporter to advanced search page
 624  ALTER TABLE eventum_custom_filter ADD COLUMN cst_reporter int(11) unsigned DEFAULT NULL AFTER cst_users;
 625  
 626  # July 29th
 627  ALTER TABLE eventum_faq ADD COLUMN faq_rank TINYINT(2) UNSIGNED NOT NULL;
 628  ALTER TABLE eventum_reminder_action ADD COLUMN rma_boilerplate varchar(255) DEFAULT NULL;
 629  UPDATE eventum_reminder_action SET rma_boilerplate='Please take immediate action!';
 630  
 631  # July 30th
 632  INSERT INTO eventum_time_tracking_category (ttc_title, ttc_created_date) VALUES ('Note Discussion', now());
 633  
 634  # Aug 17th
 635  INSERT INTO eventum_history_type VALUES(null, 'issue_bulk_updated', 0);
 636  
 637  # November 3rd
 638  ALTER TABLE eventum_mail_queue ADD COLUMN maq_type_id int(11) unsigned default NULL;
 639  ALTER TABLE eventum_mail_queue ADD INDEX (maq_type, maq_type_id);
 640  
 641  ALTER TABLE eventum_issue ADD COLUMN iss_root_message_id varchar(255);
 642  
 643  ALTER TABLE eventum_note ADD INDEX not_parent_id (not_parent_id);
 644  ALTER TABLE eventum_note ADD COLUMN not_message_id varchar(255);
 645  ALTER TABLE eventum_note ADD INDEX not_message_id (not_message_id);
 646  ALTER TABLE eventum_note ADD COLUMN not_removed tinyint(1) NOT NULL DEFAULT 0;
 647  
 648  
 649  ALTER TABLE eventum_issue_attachment ADD COLUMN iat_status enum('internal', 'public') NOT NULL default 'public';
 650  ALTER TABLE eventum_issue_attachment ADD COLUMN iat_not_id int(11) unsigned DEFAULT NULL;
 651  
 652  ALTER TABLE eventum_note ADD COLUMN not_has_attachment tinyint(1) NOT NULL default 0;
 653  
 654  # May 12th
 655  ALTER TABLE eventum_support_email CHANGE COLUMN sup_to sup_to text;
 656  ALTER TABLE eventum_support_email CHANGE COLUMN sup_cc sup_cc text;
 657  
 658  # October 2nd
 659  ALTER TABLE eventum_user ADD COLUMN usr_lang varchar(5);
 660  
 661  
 662  ALTER TABLE eventum_custom_field_option CHANGE COLUMN cfo_value cfo_value varchar(128) NOT NULL;
 663  
 664  
 665  # March 16th (adding missing type)
 666  INSERT INTO eventum_history_type SET htt_name = 'draft_routed',  htt_role = 4;
 667  
 668  
 669  # May 22nd
 670  ALTER TABLE eventum_irc_notice ADD INDEX ino_status (ino_status);
 671  
 672  # June 21st
 673  ALTER TABLE eventum_issue_custom_field ADD COLUMN icf_value_integer int(11) NULL DEFAULT NULL;
 674  ALTER TABLE eventum_issue_custom_field ADD COLUMN icf_value_date date NULL DEFAULT NULL;
 675  
 676  # October 6th
 677  ALTER TABLE eventum_issue ADD COLUMN iss_customer_contract_id int(11) unsigned AFTER iss_customer_id;


Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7