Contents
PR Summary
What problems was I solving
The iptoasn.com IPv4-to-ASN feed (and potentially the Spamhaus ASNDROP blocklist) contains 4-byte ASN values in the RFC 6996 private-use range (4,200,000,000–4,294,967,294). These exceed the signed int4 maximum of 2,147,483,647, so page_analytics_service.asn_ranges.asn and page_analytics_service.asn_blocklist.asn could not accept that data before it was even loaded.
What user-facing changes did I ship
None. This is an internal schema correction for ASN reference data. The asnDailyRefreshWorkflow has not yet completed successfully, so the affected tables are empty and the migration runs with no data rewrite.
How I implemented it
Added migration 059.do.fix-asn-column-types.sql to ALTER both asn columns to bigint. Updated the baseline page_analytics_service.sql schema dump and regenerated the Sapatos TypeScript schema so reads use db.Int8String and inserts accept number | bigint | db.Int8String. Updated the migration-hash snapshot test so the new migration and revised baseline dump are covered by the contract test.
Description for the changelog
Fixed the asn column type from int4 to bigint in page_analytics_service.asn_ranges and page_analytics_service.asn_blocklist to support 4-byte ASN values in the iptoasn.com dataset. Updated the baseline schema dump, generated Sapatos types, and migration hash tests accordingly.