Skip to content

Commit 43314eb

Browse files
committed
refactor(web3): add migrations sql
1 parent 776d2c6 commit 43314eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Normalize Ethereum addresses in provider_id to lowercase to prevent case-sensitivity issues
2+
-- This migration must run BEFORE deploying the code change that lowercases addresses in parser.go
3+
-- Background: Ethereum addresses are case-insensitive, but EIP-55 uses mixed case for checksums.
4+
-- This migration ensures existing checksummed addresses are normalized to lowercase to match
5+
-- the new behavior where addresses are lowercased at parse time.
6+
--
7+
-- Note: identity_data is NOT updated because it's only metadata for display purposes.
8+
-- The provider_id field is the only field used for identity lookup and uniqueness.
9+
10+
/* auth_migration: 20251202014000 */
11+
12+
-- Update all web3:ethereum provider_id entries to use lowercase addresses
13+
-- Format: "web3:ethereum:0xABCDEF..." -> "web3:ethereum:0xabcdef..."
14+
update {{ index .Options "Namespace" }}.identities
15+
set provider_id = lower(provider_id)
16+
where provider = 'web3'
17+
and provider_id LIKE 'web3:ethereum:0x%';

0 commit comments

Comments
 (0)