Files
orderPRO/database/migrations/20260315_000054_create_email_mailboxes_table.sql
Jacek Pyziak 3223aac4d9 feat(13-email-mailboxes): phase 13 complete — email DB foundation + SMTP mailbox CRUD
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>
2026-03-15 23:57:33 +01:00

17 lines
807 B
SQL

CREATE TABLE IF NOT EXISTS `email_mailboxes` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`smtp_host` VARCHAR(255) NOT NULL,
`smtp_port` SMALLINT UNSIGNED NOT NULL DEFAULT 587,
`smtp_encryption` ENUM('tls','ssl','none') NOT NULL DEFAULT 'tls',
`smtp_username` VARCHAR(255) NOT NULL,
`smtp_password_encrypted` TEXT NOT NULL,
`sender_email` VARCHAR(255) NOT NULL,
`sender_name` VARCHAR(200) DEFAULT NULL,
`is_default` TINYINT(1) NOT NULL DEFAULT 0,
`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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;