CREATE TABLE IF NOT EXISTS `ohrm_saml_id_provider` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `metadata` text DEFAULT NULL,
  `username_key` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8  ;

CREATE TABLE IF NOT EXISTS `ohrm_saml_user_identity` (
  `user_id` int(10) ,
  `provider_id` int(10) ,
  `user_identity` varchar(255) DEFAULT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;

ALTER TABLE `ohrm_saml_user_identity`
  ADD CONSTRAINT  FOREIGN KEY (`user_id`) REFERENCES `ohrm_user` (`id`) ON DELETE SET NULL;
ALTER TABLE `ohrm_saml_user_identity`
  ADD CONSTRAINT  FOREIGN KEY (`provider_id`) REFERENCES `ohrm_saml_id_provider` (`id`) ON DELETE SET NULL;



