-- BrowsX-only flow: data keyed by user email (no users table).
-- Use this if you only use BrowsX for login and Post Profit for data storage.
-- Run in phpMyAdmin after creating database and user in cPanel.

CREATE TABLE IF NOT EXISTS `ac_user_data` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_email` varchar(255) NOT NULL,
  `data` longtext NOT NULL COMMENT 'JSON: posts, message_segments, message_groups, settings, active_automations',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_email` (`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
