-- Security enhancement: Add rate limiting table
CREATE TABLE IF NOT EXISTS rate_limits (
    id INT PRIMARY KEY AUTO_INCREMENT,
    identifier VARCHAR(255) NOT NULL,
    action VARCHAR(50) NOT NULL DEFAULT 'login',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_identifier_action_time (identifier, action, created_at)
);

-- Update existing upload directories permissions (run manually if needed)
-- ALTER TABLE companies MODIFY logo VARCHAR(255) NULL;