


# Dump of table admin
# ------------------------------------------------------------


CREATE TABLE `admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

DROP TRIGGER IF EXISTS `admin_create`;
DROP TRIGGER IF EXISTS `admin_update`;
CREATE TRIGGER `admin_create` BEFORE INSERT ON `admin` FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW();
CREATE TRIGGER `admin_update` BEFORE UPDATE ON `admin` FOR EACH ROW SET NEW.updated_at = NOW();

# Dump of table mail
# ------------------------------------------------------------


CREATE TABLE `mail` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `source_id` int(11) NOT NULL,
  `email_from` varchar(255) NOT NULL,
  `email_replyTo` varchar(255) NOT NULL,
  `email_to` varchar(255) NOT NULL,
  `msg_subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `priority` int(11) NOT NULL,
  `add_date` datetime NOT NULL,
  `sent_date` datetime,
  `sent_status` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

DROP TRIGGER IF EXISTS `mail_create`;
DROP TRIGGER IF EXISTS `mail_update`;
CREATE TRIGGER `mail_create` BEFORE INSERT ON `mail` FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW();
CREATE TRIGGER `mail_update` BEFORE UPDATE ON `mail` FOR EACH ROW SET NEW.updated_at = NOW();





# Dump of table source
# ------------------------------------------------------------


CREATE TABLE `source` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(250) DEFAULT NULL,
  `mail_from` varchar(250) DEFAULT NULL,
  `sec_hash` varchar(250) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

DROP TRIGGER IF EXISTS `source_create`;
DROP TRIGGER IF EXISTS `source_update`;
CREATE TRIGGER `source_create` BEFORE INSERT ON `source` FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW();
CREATE TRIGGER `source_update` BEFORE UPDATE ON `source` FOR EACH ROW SET NEW.updated_at = NOW();





