--
-- Host: localhost    Database: ana3rwsa_seo
-- ------------------------------------------------------


--
-- Table structure for table `subscribe`
--

CREATE TABLE `subscribe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(200) NOT NULL,
  `created` datetime NOT NULL,
  `last_message` text NOT NULL,
  `message_viewed` tinyint(1) NOT NULL,
  `submit_msg` tinyint(1) NOT NULL,
  `message_send` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `subscribe`
--

INSERT INTO `subscribe` VALUES (1,'ahmedbakr152@gmail.com','2016-04-21 03:48:36','<p>Welcome this is default message from ana3rwsa...</p>',1,1,1),(2,'abanoub.metyas.btm@gmail.com','2016-04-21 03:52:46','<p>Welcome this is default message from ana3rwsa...</p>',1,1,1),(3,'ibrahim@seoera.net','2016-05-03 09:54:33','<p>Welcome this is default message from ana3rwsa...</p>',1,1,1);
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`ana3rwsa`@`localhost`*/ /*!50003 TRIGGER `subscribe_delete` BEFORE DELETE ON `subscribe` FOR EACH ROW insert into ana3rwsa_archive.subscribe
(`email`, `created`,`last_message`, `inserted_date`, `trigger_method`)
select
`email`, `created`,`last_message`, sysdate(), 'deleted'
from subscribe
where id = OLD.id */;;
DELIMITER ;

--
-- Dumping routines for database 'ana3rwsa_seo'
--


