feat(v1.5.2): Execute database migrations and complete setup
- 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>
This commit is contained in:
51
migrations/README.md
Normal file
51
migrations/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Migrations
|
||||
|
||||
Schema migrations para as tabelas cr_* (Claude Resources) da infraestrutura Descomplicar.
|
||||
|
||||
## Ficheiros
|
||||
|
||||
| Migration | Descrição |
|
||||
|-----------|-----------|
|
||||
| `001_initial_schema.sql` | Tabelas core (agents, skills, mcps, sdks, plugins, hooks) |
|
||||
| `002_add_lsps.sql` | Tabela de Language Server Protocols |
|
||||
| `003_add_relationships.sql` | Tabelas de relacionamento (agent_mcps, skill_mcps, etc.) |
|
||||
| `004_add_telemetry.sql` | Tabelas de uso/telemetria |
|
||||
| `005_add_archive_tables.sql` | Tabelas de arquivo para telemetria antiga |
|
||||
| `006_add_maintenance_log.sql` | Controlo de migrations e log de manutenção |
|
||||
|
||||
## Uso
|
||||
|
||||
### Ver status
|
||||
```bash
|
||||
/descomplicar:db-migrate status
|
||||
```
|
||||
|
||||
### Aplicar todas
|
||||
```bash
|
||||
/descomplicar:db-migrate up --all
|
||||
```
|
||||
|
||||
### Reverter última
|
||||
```bash
|
||||
/descomplicar:db-migrate down
|
||||
```
|
||||
|
||||
## Formato
|
||||
|
||||
Cada ficheiro contém:
|
||||
- Header com metadata (Author, Date, Description)
|
||||
- Secção `-- UP` com SQL de criação
|
||||
- Secção `-- DOWN` com SQL de reversão
|
||||
|
||||
## Criar Nova Migration
|
||||
|
||||
```bash
|
||||
/descomplicar:db-migrate create nome_da_migration
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
- As migrations são aplicadas em ordem numérica
|
||||
- O checksum é verificado antes de aplicar
|
||||
- Rollback automático em caso de erro
|
||||
- Log completo em `cr_migrations`
|
||||
Reference in New Issue
Block a user