-- DROP TABLE IF EXISTS `newsletter_mail`;

CREATE TABLE IF NOT EXISTS `newsletter_mail` (
  `email` varchar(254) NOT NULL,
  `newsletter_list_id` INT UNSIGNED,
  `data` text NOT NULL,
  `status` tinyint(6) NOT NULL DEFAULT '0', -- unread = 0, read = 1
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`email`, `newsletter_list_id`),
  KEY `newsletter_list` (`newsletter_list_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

