3 migrations (email_mailboxes, email_templates, email_logs), full CRUD for SMTP mailboxes with encrypted passwords (IntegrationSecretCipher), native SMTP connection test via stream_socket_client, sidebar navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14 lines
711 B
SQL
14 lines
711 B
SQL
CREATE TABLE IF NOT EXISTS `email_templates` (
|
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
`name` VARCHAR(200) NOT NULL,
|
|
`subject` VARCHAR(500) NOT NULL,
|
|
`body_html` TEXT NOT NULL,
|
|
`mailbox_id` INT UNSIGNED DEFAULT NULL,
|
|
`is_active` TINYINT(1) NOT NULL DEFAULT 1,
|
|
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_email_templates_mailbox` (`mailbox_id`),
|
|
CONSTRAINT `fk_email_templates_mailbox` FOREIGN KEY (`mailbox_id`) REFERENCES `email_mailboxes` (`id`) ON DELETE SET NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|