Websites · Glossary
What is seed data?
Seed data is the set of rows inserted into a newly created database so it is not empty: sample products, a few test bookings, reference lists such as countries or categories. Developers run a seed script after migrations so every development or test copy starts in the same known state. Production databases usually receive only reference data, never fake customers.
An empty database makes a new site hard to judge. Seed data gives every page something to show and every test something to check, without touching real customers' information.
Nuwan Madhusanka · Co-founder
4 min read · Published
| Kind | What it is | Where it belongs |
|---|---|---|
| Seed data | Rows inserted to start a database in a known state | Development and test databases; reference rows in production |
| Fixtures | Fixed rows loaded for a specific automated test | Test runs only, reset between tests |
| Reference data | Lists the app needs to work, such as categories or states | Every environment, including production |
| Production data | Real customers' records | Production only; copied elsewhere only when anonymised |
What it is
Seed data is applied after the schema exists. Migrations create the tables; a seed fills them with a starting set of rows. Supabase's local tooling, for example, looks for a supabase/seed.sql file and runs it when a local database is reset, and its documentation advises keeping data insertions in seed files and schema statements in migrations. For larger volumes, data can be generated with SQL functions such as generate_series or with a data generation tool.
How it is used
On a development machine, a reset rebuilds the database from migrations and then runs the seed, so everyone on a team sees the same sample products and the same three test bookings. Automated tests seed the rows they need, run, and reset. Demo environments are seeded with realistic but fictional content so a client can click around. In production, only rows the application cannot work without are seeded, such as a list of service categories or the first admin account, usually through a migration rather than a separate script.
When it matters
Seed data matters most at the start of a project and whenever a new environment is created. Without it, a new website's pages show empty states that hide layout problems, and nobody can check how a list looks with forty items or how a long product name wraps. It also matters for privacy: copying real customer data into a test database to have something realistic is a common way personal information leaks, and seeding fictional data avoids it.
Common mistakes
Seeding fake orders or customers into production by accident. Copying production data to development without anonymising it. Seeds that depend on generated ids and break when run twice. Sample data so tidy that it hides real world problems, such as every name being five letters long. Leaving placeholder images and prices visible after launch. Putting schema changes in seed files. And forgetting to update the seed when the schema changes, so resets fail.
Where it shows up in OneCraft
OneCraft's 65 capability guides describe features the agent builds from scratch for each site, with nothing pre-made: it writes the tables, access rules, screens and admin itself, and the migrations and a supabase/schema.sql file go into the site's repository. Every table must have row level security, and the agent checks new tables as an anonymous visitor and as a signed in person. With the admin guide, the agent creates the first admin from the owner's contact email.
Questions people ask
Should seed data go into production?
Only reference data the app needs, such as categories, statuses or the first admin account. Never fake customers, orders or reviews. Mixing test rows into a live database confuses reports, can send real emails to fake addresses and can mislead customers if sample content becomes visible.
What is the difference between seed data and dummy data?
Dummy data is any fake data used for testing or design. Seed data is the specific set loaded into a new database to start it in a known state, which may include dummy rows and real reference rows. In everyday speech the two terms are often used for the same sample rows.
How much seed data do I need?
Enough to exercise each page and its edge cases: a handful of normal items, one with a very long name, one with no image, one sold out, and enough rows to trigger pagination. A few dozen well chosen rows usually reveal more than thousands of random ones.
Can I generate seed data automatically?
Yes. SQL can generate rows with functions such as generate_series, and data generation tools create realistic names, addresses and dates. Keep generated personal data clearly fictional, and fix a random seed so every run produces the same rows and tests stay repeatable.
Is seed data the same as a backup?
No. A backup is a copy of real data taken to restore after a failure. Seed data is a deliberate starting set for new databases. Restoring a production backup into development is a different practice that needs anonymisation first, because it brings real personal information along.
Make one with websites
The button opens the generator with this use case already described. Change the wording to match your own.
Create a website with OneCraftRelated questions
- What is a database migration?What is a database migration? A numbered SQL file that changes a database schema and lives in the code repository, so every copy can be rebuilt the same way.
- What is a Postgres schema?What is a Postgres schema? A named namespace of tables, views and functions inside one database, how search_path finds them, and how schemas separate tenants.
- What is an admin role?What is an admin role? A role that grants management rights on a site or app, enforced by the database rather than the menu, with member and admin compared.
- What is a storage bucket?What is a storage bucket? A named container for files with its own access rules and size limits. Public and private buckets compared, with examples.
Written and checked by the OneCraft team. Last checked .