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.
fix(db): drop public_token_failures + funcoes orfas (Onda 9, B-8 encerrada) #200
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
Uh oh!
There was an error while loading. Please reload this page.
fix(db): drop public_token_failures + funcoes orfas (Onda 9, B-8 encerrada) #200
Changes from all commits
ad592a400c956aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: A documentação diz que a migration
20260507161547foi deletada, mas ela ainda existe e foi apenas neutralizada. Corrija o texto para evitar histórico/auditoria inconsistente.Prompt for AI agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistência na documentação com estado real.
A linha 96 afirma que a migration
20260507161547_drop_public_token_tables.sqlfoi deletada do repo, mas na verdade ela ainda existe — apenas foi neutralizada pra um SELECT 1 no-op com comentário "SUPERSEDED". Corrigir pra refletir o estado correto: "neutralizada" ou "convertida em no-op", não "deletada".🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On any database built from the repo migrations,
supabase/migrations/20260419125044_030d3b11-a20a-4092-8fd3-f30da17ff7e8.sql:212-215schedulesauto-block-extreme-offendersto runSELECT public.auto_block_extreme_offenders();every 15 minutes, and I don't see a latercron.unschedulefor that job. Dropping the function here leaves that active pg_cron job pointing at a missing function, so it will start failing every run until the migration unschedules or disables the job first.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping
public.public_token_failuresstill leaves live admin security UI queries against that table:src/components/admin/security/AnomalyCards.tsx:44/:48andTopOffenderIpsCard.tsx:33, rendered fromAdminSegurancaAcessoPage. After this migration runs, opening that page will repeatedly issue PostgREST requests for a relation that no longer exists, so the anomaly/token-failure cards and top-offender aggregation lose data or fail until those callers are removed or retargeted to another table.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table drop leaves older public-token RPC functions behind:
submit_quote_responsestill updatesquote_approval_tokens, andrecord_public_token_failurestill inserts intopublic_token_failuresand updates both token tables; I found theirCREATE OR REPLACE FUNCTIONmigrations but no matchingDROP FUNCTIONinsupabase/migrations. On a database built from these migrations, those RPCs remain exposed but fail at runtime once this migration removes the tables, so they should be dropped in the same cleanup.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.