- Execute all 6 migrations on Desk CRM production database - Create missing tables: cr_lsps, cr_agent_lsps, cr_lsp_usage - Create archive tables: cr_*_usage_archive (4 tables) - Create system tables: cr_migrations, cr_maintenance_log - Make all scripts executable (chmod +x) - Total cr_* tables: 38 Migration files: - 001_initial_schema.sql - 002_add_lsps.sql - 003_add_relationships.sql - 004_add_telemetry.sql - 005_add_archive_tables.sql - 006_add_maintenance_log.sql Scripts: - session-init.sh, session-end.sh - inject-context.sh, inject-agent-context.sh - record-usage.sh, db-backup.sh, sync-to-mysql.sh Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
722 B
SQL
27 lines
722 B
SQL
-- 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;
|