-
Notifications
You must be signed in to change notification settings - Fork 0
perf(diagnostics): count:exact → planned/estimated em tabelas particionadas #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc9eecc
fix(ci): hardening proteção GHCR — 5 correções no pipeline TAGS (C5+F…
claude adbe59e
perf(diagnostics): substituir count:exact por planned/estimated em ta…
claude 35a7ece
fix(diagnostics): corrige inconsistências matemáticas e de medição no…
claude 9de267a
perf(db): corrige count modes e polling em 4 arquivos críticos
claude 490fb53
perf: corrige fetch ilimitado em TalkX e count:exact desnecessários
claude 2b166a8
fix(deploy): falhar explicitamente ao detectar SHAs inválidas no arqu…
claude 735a724
merge(main): resolve conflitos para atualizar PR #913 com main
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Migration Drift Report | ||
|
|
||
| **Data**: 2026-08-06 | ||
| **Gerado por**: Auditoria automatizada | ||
| **Status**: Parcial — requer acesso ao banco para lista completa | ||
|
|
||
| ## Problema | ||
|
|
||
| Aproximadamente 15 versões de migration foram aplicadas diretamente no banco de dados de produção via MCP/SQL sem que os arquivos `.sql` correspondentes existam no filesystem `supabase/migrations/`. | ||
|
|
||
| Isso cria um **drift** entre o estado do banco e o estado do código — migrações aplicadas no banco não são rastreadas no Git. | ||
|
|
||
| ## Risco | ||
|
|
||
| | Risco | Severidade | Impacto | | ||
| |-------|-----------|---------| | ||
| | Perda de migrações em restore | 🔴 Crítico | Banco restaurado ficaria sem as migrações perdidas | | ||
| | Inconsistência em novas instâncias | 🟠 Alto | Deploy em novo ambiente falharia | | ||
| | Impossibilidade de rollback | 🟠 Alto | Sem arquivo SQL, rollback manual é difícil | | ||
| | Desconhecimento do estado real | 🟡 Médio | Time não sabe o que foi aplicado | | ||
|
|
||
| ## Migrações com Drift Conhecido | ||
|
|
||
| As seguintes migrações foram aplicadas via MCP mas podem não ter arquivo SQL correspondente: | ||
|
|
||
| | Migration | Conteúdo | Status do Arquivo | | ||
| |-----------|---------|------------------| | ||
| | `20260717000002_create_missing_rpcs_stubs.sql` | RPCs stubs (initiate_gmail_oauth, etc.) | ⚠️ Verificar | | ||
| | `20260721_fix_cursor_rpcs_and_search_path.sql` | Fix search_path + dispatch_error_logs | ⚠️ Verificar | | ||
| | Outras ~13 | Desconhecido — aplicadas via MCP | ❌ Sem arquivo | | ||
|
|
||
| ## Ação Recomendada | ||
|
|
||
| 1. **Inventariar**: `SELECT version FROM supabase_migrations.schema_migrations ORDER BY version DESC LIMIT 30;` | ||
| 2. **Comparar**: verificar quais versões têm arquivo em `supabase/migrations/` | ||
| 3. **Retrocriar**: para cada versão sem arquivo, criar o `.sql` reconstruindo do `pg_dump` | ||
| 4. **Proteger**: adicionar hook de CI que rejeita deploy se `schema_migrations` divergir do filesystem | ||
|
|
||
| ## Comandos para Diagnóstico | ||
|
|
||
| ```sql | ||
| -- Versões no banco (via Supabase MCP) | ||
| SELECT version, inserted_at | ||
| FROM supabase_migrations.schema_migrations | ||
| ORDER BY inserted_at DESC | ||
| LIMIT 30; | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Versões no filesystem | ||
| ls supabase/migrations/ | sort -r | head -30 | ||
| ``` | ||
|
|
||
| ## Próximo Passo | ||
|
|
||
| Executar diagnóstico via Supabase MCP para inventário completo. Tarefa pendente de alta prioridade. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.