--
-- Host: localhost    Database: tempmail
-- ------------------------------------------------------


--
-- Current Database: `tempmail`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `tempmail` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;

USE `tempmail`;

--
-- Table structure for table `emails`
--

CREATE TABLE `emails` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `inbox_id` bigint(20) NOT NULL,
  `from_addr` varchar(320) NOT NULL DEFAULT '',
  `to_addr` varchar(320) NOT NULL DEFAULT '',
  `subject` varchar(1000) NOT NULL DEFAULT '',
  `body_text` mediumtext DEFAULT NULL,
  `body_html` mediumtext DEFAULT NULL,
  `received_at` datetime NOT NULL DEFAULT current_timestamp(),
  `seen` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `inbox_id` (`inbox_id`),
  CONSTRAINT `fk_email_inbox` FOREIGN KEY (`inbox_id`) REFERENCES `inboxes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `emails`
--

INSERT INTO `emails` VALUES (1,1,'tester@example.com','fiz8nz2q9q@tempmail.local','Welcome!','Your temp mail works.\r\n','<h2>Welcome!</h2><p>Your temp mail works.</p><p><b>It works! 🎉</b></p>\r\n','2026-08-06 15:34:56',1),(2,9,'tester@example.com','kqm80dz4pu@tempmail.local','Live check','If you see this, receiving works.\r\n','<h2>Live check</h2><p>If you see this, receiving works.</p><p><b>It works! 🎉</b></p>\r\n','2026-08-07 10:24:30',1);

--
-- Table structure for table `inboxes`
--

CREATE TABLE `inboxes` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `address` varchar(255) NOT NULL,
  `token` varchar(64) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `expires_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `address` (`address`),
  UNIQUE KEY `token` (`token`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `inboxes`
--

INSERT INTO `inboxes` VALUES (1,'fiz8nz2q9q@tempmail.local','WNwHdDz80GD9A1ALGcge2avLGhyebL_l','2026-08-06 15:34:54','2026-08-06 16:34:54'),(2,'8r3cvfmrov@tempmail.local','WAUgXvFvudBOoxfz8eFVhv3LvytVTqyJ','2026-08-06 15:37:07','2026-08-06 16:37:07'),(3,'jhxguxhe6n@tempmail.local','XGkQhvzvCrxyft2Kv3zF0SgFkoHDueYj','2026-08-06 16:36:03','2026-08-06 17:36:03'),(4,'gh0n7dba7h@tempmail.local','mhlEL3rhV672S37KTuInDJIuZLjVmXAK','2026-08-06 16:37:13','2026-08-06 17:37:13'),(5,'ow3mwcl4t3@tempmail.local','H6NBQLjCD5ZIHG0iDz__qOxq5KalClXp','2026-08-07 10:13:05','2026-08-07 11:13:05'),(6,'1uhya7fj9d@tempmail.local','1gIFlhO-Z-cpAGud9W0GBL0EwnS6l4L_','2026-08-07 10:14:01','2026-08-07 11:14:01'),(7,'lac94vo4p1@tempmail.local','TNzmYS92Kbp5edrRKh_yEao-RL7Q47ej','2026-08-07 10:21:42','2026-08-07 11:21:42'),(8,'sz69u0x8ot@tempmail.local','7eVZlkpjLtRCdrf7TomrGitK0WKdUlrw','2026-08-07 10:21:44','2026-08-07 11:21:44'),(9,'kqm80dz4pu@tempmail.local','t-0cRwGPALgSQnYjcFHZyh-xrFXA59Zj','2026-08-07 10:21:45','2026-08-07 11:21:45');


