CREATE TABLE IF NOT EXISTS tblpreferences_email_static (
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  name VARCHAR(100) NOT NULL,
  codename VARCHAR(100) NOT NULL,
  preferences_for ENUM('tenant','staff') NOT NULL,
  PRIMARY KEY (id)
) ENGINE=INNODB DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS tbltenant_email_preferences (
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  codename VARCHAR(100) NOT NULL,
  tenant_id BIGINT(20) UNSIGNED NOT NULL,
  staff_id BIGINT(20) UNSIGNED,
  active tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (id)
) ENGINE=INNODB DEFAULT CHARSET=utf8;

 INSERT INTO tblpreferences_email_static (name,codename,preferences_for)
 VALUES('Weekly Report','weekly-report','tenant');
