fix(indexer): bump warbow_revenge_window migration timestamp to resolve PK collision (GitLab #150) #374

Closed
Brouie wants to merge 324 commits from fix/gl150-migration-timestamp-collision into main
Brouie commented 2026-05-05 03:47:38 +00:00 (Migrated from gitlab.com)

closes #150.

two migrations independently chose version 20260504200000:

  • 20260504200000_doub_vesting_rescue_erc20 (#137)
  • 20260504200000_warbow_revenge_window_gl135 (#135)

sqlx primary-keys _sqlx_migrations on version. first applies fine, second collides on PK and the indexer cannot bootstrap on a clean DB at HEAD 16deec2.

bumps the warbow_revenge_window pair to 20260504201000 so both migrations apply ordered:

20260504200000_doub_vesting_rescue_erc20.{up,down}.sql       (unchanged)
20260504201000_warbow_revenge_window_gl135.{up,down}.sql     (renamed)

content of either migration is untouched — pure rename. since neither migration has been run on prod yet (this is a pre-mainnet TGE window), no down-migration / re-apply required for existing envs.

repro before fix:

docker exec yieldomega-pg psql -U yieldomega -d postgres -c "DROP DATABASE IF EXISTS yieldomega_indexer;"
docker exec yieldomega-pg psql -U yieldomega -d postgres -c "CREATE DATABASE yieldomega_indexer OWNER yieldomega;"
cd indexer && cargo run --release
# fails on 'duplicate key value violates unique constraint _sqlx_migrations_pkey'

after fix: clean bootstrap. once merged, will pull on QA server, bring up stack, walk #144 live.

cc @PlasticDigits

closes #150. two migrations independently chose version `20260504200000`: - `20260504200000_doub_vesting_rescue_erc20` (#137) - `20260504200000_warbow_revenge_window_gl135` (#135) sqlx primary-keys `_sqlx_migrations` on version. first applies fine, second collides on PK and the indexer cannot bootstrap on a clean DB at HEAD `16deec2`. bumps the warbow_revenge_window pair to `20260504201000` so both migrations apply ordered: ``` 20260504200000_doub_vesting_rescue_erc20.{up,down}.sql (unchanged) 20260504201000_warbow_revenge_window_gl135.{up,down}.sql (renamed) ``` content of either migration is untouched — pure rename. since neither migration has been run on prod yet (this is a pre-mainnet TGE window), no down-migration / re-apply required for existing envs. repro before fix: ``` docker exec yieldomega-pg psql -U yieldomega -d postgres -c "DROP DATABASE IF EXISTS yieldomega_indexer;" docker exec yieldomega-pg psql -U yieldomega -d postgres -c "CREATE DATABASE yieldomega_indexer OWNER yieldomega;" cd indexer && cargo run --release # fails on 'duplicate key value violates unique constraint _sqlx_migrations_pkey' ``` after fix: clean bootstrap. once merged, will pull on QA server, bring up stack, walk #144 live. cc @PlasticDigits
Brouie commented 2026-05-05 03:48:20 +00:00 (Migrated from gitlab.com)

mentioned in issue #150

mentioned in issue #150
Brouie commented 2026-05-05 03:52:24 +00:00 (Migrated from gitlab.com)

verified clean bootstrap on QA server with the renamed migration. dropped+recreated yieldomega_indexer DB, ran indexer at this branch HEAD against fresh anvil + registry json:

INFO yieldomega_indexer: loaded config chain_id=31337 rpc=http://127.0.0.1:8545
INFO yieldomega_indexer::db: running pending migrations
INFO yieldomega_indexer: API listening addr=127.0.0.1:3100
INFO yieldomega_indexer::ingestion: bootstrapped chain pointer before effective_start block=0
INFO yieldomega_indexer::ingestion: ingestion started addresses=7 effective_start=1 tip=0

no PK collision. both migrations applied ordered:

20260504200000 doub vesting rescue erc20                | t
20260504201000 warbow revenge window gl135              | t

ready to merge on your end.

verified clean bootstrap on QA server with the renamed migration. dropped+recreated `yieldomega_indexer` DB, ran indexer at this branch HEAD against fresh anvil + registry json: ``` INFO yieldomega_indexer: loaded config chain_id=31337 rpc=http://127.0.0.1:8545 INFO yieldomega_indexer::db: running pending migrations INFO yieldomega_indexer: API listening addr=127.0.0.1:3100 INFO yieldomega_indexer::ingestion: bootstrapped chain pointer before effective_start block=0 INFO yieldomega_indexer::ingestion: ingestion started addresses=7 effective_start=1 tip=0 ``` no PK collision. both migrations applied ordered: ``` 20260504200000 doub vesting rescue erc20 | t 20260504201000 warbow revenge window gl135 | t ``` ready to merge on your end.
Brouie commented 2026-05-05 04:35:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #129

mentioned in issue #129
Brouie commented 2026-05-05 04:39:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #113

mentioned in issue #113
Brouie commented 2026-05-05 04:59:22 +00:00 (Migrated from gitlab.com)

mentioned in issue #151

mentioned in issue #151
PlasticDigits commented 2026-05-05 05:38:03 +00:00 (Migrated from gitlab.com)

added 4 commits

  • 51e3eb67...3d20ecf7 - 4 commits from branch PlasticDigits:main

Compare with previous version

added 4 commits <ul><li>51e3eb67...3d20ecf7 - 4 commits from branch <code>PlasticDigits:main</code></li></ul> [Compare with previous version](/PlasticDigits/yieldomega/-/merge_requests/4/diffs?diff_id=1782257129&start_sha=51e3eb67bc03ec23ab31fd56f4881be557c19d5f)
PlasticDigits (Migrated from gitlab.com) closed this pull request 2026-05-05 05:38:37 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega!374
No description provided.