CREATE TABLE IF NOT EXISTS pending_messages ( id INT AUTO_INCREMENT PRIMARY KEY, code VARCHAR(64) UNIQUE NOT NULL, -- کد یکتا برای هر پیام type ENUM('message', 'forward') NOT NULL, content TEXT, from_chat_id BIGINT, message_id INT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE IF NOT EXISTS sent_messages ( id INT AUTO_INCREMENT PRIMARY KEY, message_code VARCHAR(64) NOT NULL, chat_id BIGINT NOT NULL, sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UNIQUE KEY (message_code, chat_id) );