--
-- Host: localhost    Database: user210
-- ------------------------------------------------------


--
-- Table structure for table `newsletters`
--

CREATE TABLE `newsletters` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `send_date` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `newsletters`
--

INSERT INTO `newsletters` VALUES (1,'Новинки в мире технологий','Последние новости о гаджетах и разработках','2025-03-12 18:09:02'),(2,'Секреты программирования','Лучшие советы по кодингу','2025-03-12 18:09:02');

--
-- Table structure for table `subscribers`
--

CREATE TABLE `subscribers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `subscriber_name` varchar(100) NOT NULL,
  `subscriber_email` varchar(255) NOT NULL,
  `subscriber_login` varchar(50) NOT NULL,
  `subscriber_password` varchar(255) NOT NULL,
  `newsletter_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscriber_email` (`subscriber_email`),
  UNIQUE KEY `subscriber_login` (`subscriber_login`),
  KEY `newsletter_id` (`newsletter_id`),
  CONSTRAINT `subscribers_ibfk_1` FOREIGN KEY (`newsletter_id`) REFERENCES `newsletters` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `subscribers`
--

INSERT INTO `subscribers` VALUES (1,'Иван Петров','ivan@example.com','ivan_petrov','ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f',1),(2,'Анна Смирнова','anna@example.com','anna_smirnova','fbb4a8a163ffa958b4f02bf9cabb30cfefb40de803f2c4c346a9d39b3be1b544',2);


