9201e1200eaf8329bdf51180b952b71a904275c5
Seeding adds ~14M files a day; 32-bit ids run out at 2.1 billion in about five months. Postgres can't change a partition key's type, so the migration detaches the partitions, rewrites each as a plain table (a CHECK added first spares the attach scan), and attaches them to a new 64-bit parent with the same indexes, foreign keys and triggers. binaries.file_id and the id sequence become 64-bit too. Meant to run with the writers stopped and Postgres on wal_level=minimal (compose: PG_WAL_LEVEL, PG_MAX_WAL_SENDERS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Languages
TypeScript
95.5%
JavaScript
2.4%
CSS
1.4%
HTML
0.6%
Dockerfile
0.1%