Indexer: add down migration for timecurve_unredeemed_launched_token (151-1) #152
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#152
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The migration
20260504180000_timecurve_unredeemed_launched_tokenships*.up.sqlonly — there is no paired*.down.sql. Every other migration inindexer/migrations/follows the paired pattern.Impact: Operators cannot roll back this schema step via the SQLx migration runner. A forced post-deploy revert requires manual
DROP TABLEplus manual reconciliation of_sqlx_migrations, which blocks clean re-application of the same version and breaks automated rollback playbooks ahead of mainnet/TGE-style deploys.Split from GitLab #151 (Finding 1 — Medium). Feature background: unredeemed launched-token sweep observability (GitLab #128).
Related code & docs
indexer/migrations/20260504180000_timecurve_unredeemed_launched_token.up.sqlindexer/migrations/20260504180000_timecurve_unredeemed_launched_token.down.sql(new; pair with.up.sql)indexer/src/decoder.rs— unredeemed launched-token eventsdocs/testing/invariants-and-business-logic.md— anchorINV-INDEXER-128/ unredeemed sweep.cursor/skills/yieldomega-guardrails/SKILL.mdUnredeemedLaunchedTokenRecipientSet/ sweep (see decoder + #128)Contracts / frontend: No code change required for closing this ticket — only the indexer migration pair.
Acceptance criteria
20260504180000_timecurve_unredeemed_launched_token.down.sqlexists and reverses the.upmigration: drop indexes (if not dropped withCASCADE) thenDROP TABLE IF EXISTSfor bothidx_timecurve_unredeemed_launched_token_recipient_setandidx_timecurve_unredeemed_launched_token_swept, in an order safe for FK-free standalone tables (match project style for other.down.sqlfiles).DROP TABLE IF EXISTS/DROP INDEX IF EXISTSas used elsewhere in this repo’s migrations.sqlx migrate revert(or project-standard migrate command) can apply down then up on a throwaway Postgres without error.Verification checklist
ls indexer/migrations/ | grep 20260504180000shows both.up.sqland.down.sql..down.sqlobjects to.up.sql: everyCREATE TABLE/CREATE INDEXhas a corresponding drop (naming matches).sqlx database create(if needed) →sqlx migrate run→ confirm tables exist →sqlx migrate revert(one step) → tables gone →sqlx migrate run→ tables restored._sqlx_migrationsrow for20260504180000disappears after revert and returns after re-run (no manual version hacks).cargo testfor indexer still passes if integration tests touch migrations (indexer/tests/).invariants-and-business-logic.md: no doc claim that migrations are intentionally one-way for this version; update if needed.marked this issue as related to #151
mentioned in issue #151
marked this issue as related to #128
mentioned in commit
435a446d72Implemented in main (commit on
mainafter push).What changed
indexer/migrations/20260504180000_timecurve_unredeemed_launched_token.down.sql:DROP INDEX IF EXISTSon both_blockindexes, thenDROP TABLE IF EXISTSforidx_timecurve_unredeemed_launched_token_sweptandidx_timecurve_unredeemed_launched_token_recipient_set(reverse order of.up.sqldependencies).INV-INDEXER-128SQLx paired migration /sqlx migrate revertpath (GitLab #152); indexer README § SQLx migrations; cross-links in guardrails,skills/README.md,play-timecurve-doubloon.Verification performed
cargo test+cargo clippy --all-targets -- -D warningsinindexer/(green).sqlx migrate run→ revert stack through20260504180000→ bothidx_timecurve_unredeemed_*tables absent,_sqlx_migrationsrow removed →sqlx migrate run→ tables and version row restored.Checklist for @brouie
ls indexer/migrations/ | grep 20260504180000shows.up.sqland.down.sql.sqlx migrate run(full chain) →\dt idx_timecurve_unredeemed*shows 2 tables → revert until20260504180000is undone → 0 such tables →sqlx migrate run→ tables back.SELECT * FROM _sqlx_migrations WHERE version = 20260504180000absent after that revert, present after re-run.cd indexer && cargo teststill green.Leaving issue open for your sign-off.
@PlasticDigits — verification PASS at HEAD
435a446. walked your checklist:ls indexer/migrations/ | grep 20260504180000: both.up.sqland.down.sqlpresent._sqlx_migrationsrow for version20260504180000("timecurve unredeemed launched token") showssuccess = t— clean apply on the running stack from the #150 fresh DB rebuild earlier today, no PK collision noise.skipped the disposable-DB
sqlx migrate run → revert → re-runcycle (your dev-side verification covered that path against a throwaway DB). source pair is symmetric with the rest of the migration set, sqlx applies cleanly on the live stack here.ready for close on your end.
mentioned in commit
740b22e53c