 # Dump of table article_images
 # ------------------------------------------------------------
 
+DROP TABLE IF EXISTS `article_images`;
+
 CREATE TABLE `article_images` (
   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
   `article_id` bigint(20) unsigned DEFAULT NULL,


# Dump of table article_images_history
# ------------------------------------------------------------

CREATE TABLE `article_images_history` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="" */;;
  /*!50003 CREATE */ /*!50017 DEFINER=`gotcha-admin`@`%` */ /*!50003 TRIGGER `insert_articles_history` AFTER INSERT ON `articles` FOR EACH ROW BEGIN
  INSERT INTO articles_history (title, content, writer, url, category, writed_at)
  VALUES (NEW.title, NEW.content, NEW.writer, NEW.url, NEW.category, NEW.writed_at);
END */;;
/*!50003 SET SESSION SQL_MODE="" */;;
  /*!50003 CREATE */ /*!50017 DEFINER=`gotcha-admin`@`%` */ /*!50003 TRIGGER `update_articles_history` AFTER UPDATE ON `articles` FOR EACH ROW BEGIN
  INSERT INTO articles_history (title, content, writer, url, category, writed_at)
  VALUES (NEW.title, NEW.content, NEW.writer, NEW.url, NEW.category, NEW.writed_at);
END */;;
DELIMITER ;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
