Writing a Postgres Seed Script That Survives the Next Migration
TL;DR: A seed script is a SQL or code file (seed.sql, seed.ts) that inserts a known set of rows into a Postgres database after migrations run. A good one orders inserts by foreign key, stays idempoten
mikhail-shytsko.hashnode.dev15 min read