-- Migration: 002_add_lsps
-- Author: Descomplicar®
-- Date: 2026-02-02
-- Description: Tabelas para Language Server Protocols

-- UP

-- Language Server Protocols
CREATE TABLE IF NOT EXISTS cr_lsps (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL UNIQUE,
    description TEXT,
    language VARCHAR(50),
    command VARCHAR(255),
    args JSON,
    status ENUM('active', 'inactive', 'error') DEFAULT 'active',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Índices
CREATE INDEX idx_lsps_status ON cr_lsps(status);
CREATE INDEX idx_lsps_language ON cr_lsps(language);

-- DOWN
DROP TABLE IF EXISTS cr_lsps;
