
ALTER TABLE tblcontacts ADD email_type ENUM('main','work','personal','other') DEFAULT 'main' AFTER email;
ALTER TABLE tblcontacts ADD phonenumber_type ENUM('main','work','mobile','home','fax','other') DEFAULT 'main' AFTER phonenumber;


CREATE TABLE IF NOT EXISTS tblcontacts_other_details (
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  tenant_id bigint(20) unsigned NOT NULL,
  client_id bigint(20) unsigned NOT NULL,
  field ENUM('email','phonenumber') DEFAULT 'email',
  field_type ENUM('main','work','personal','mobile','home','fax','other') DEFAULT 'main',
  value varchar(100) NOT NULL,
  created_at datetime NOT NULL,
  updated_at datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

ALTER TABLE tblleads ADD email_type ENUM('main','work','personal','other') DEFAULT 'main' AFTER email;
ALTER TABLE tblleads ADD phonenumber_type ENUM('main','work','mobile','home','fax','other') DEFAULT 'main' AFTER phonenumber;

CREATE TABLE IF NOT EXISTS tblleads_other_details (
  id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  tenant_id bigint(20) unsigned NOT NULL,
  lead_id bigint(20) unsigned NOT NULL,
  field ENUM('email','phonenumber') DEFAULT 'email',
  field_type ENUM('main','work','personal','mobile','home','fax','other') DEFAULT 'main',
  value varchar(100) NOT NULL,
  created_at datetime NOT NULL,
  updated_at datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
