Seed data

Starter records loaded into a fresh database so the app has something to show: dev fixtures, demo accounts, and required lookup rows.

fake data to develop againstprefill the empty databaseseeding the databasedummy datafixturesdemo data for a fresh installseeder scriptsample records for local dev

See it

Live demo coming soon

What it is

Seed data is the set of records a script inserts so a fresh database is actually usable. It comes in two flavors that people constantly conflate. Reference seeds are rows the product cannot run without: roles, plan tiers, currencies, country codes. Production needs these. Development seeds are believable junk: fifty fake users with Faker names, a few orders, one account already mid-onboarding, so you can see the UI in a realistic state instead of staring at empty states all day.

Write the seed script to be idempotent: upsert on a stable natural key rather than blindly inserting, so running it twice does not duplicate everything. Fix the random generator's seed value so the same command produces the same data on every machine, which turns 'works on my laptop' bugs into reproducible ones. Most stacks ship a hook for this (prisma db seed, drizzle-kit, rails db:seed, a plain SQL file run after migrations).

The classic trap: dev seeds quietly becoming production data. Someone hardcodes id 1 as the admin, prod gets seeded once, and now real code depends on a fake row. Keep the two seed sets in separate files with separate commands. Second trap: seeds that bypass your app's validation and create states your real code can never produce, so you debug phantom bugs.

Ask AI for it

Write an idempotent seed script for this schema, split into two commands: 'seed:reference' for rows production needs (roles, plan tiers, lookup tables) using upsert on a stable natural key, and 'seed:dev' for local fixtures. For the dev seed use Faker with a fixed seed value so output is deterministic, create about 25 users, 5 organizations, and enough related rows to exercise list views, pagination, and at least one empty state and one error state. Wrap everything in a transaction, never hardcode primary key values, and make re-running the script safe.

You might have meant

schema migrationupsertidempotencydatabase constraintprimary key