Seed data
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
separate reference data from test data.
Planned topics
- Reference (seed) data is needed in every environment: countries, order statuses, default roles.
- Put it in a migration, because it is part of the schema's meaning.
- Test data (fake products, fake customers) never goes in production migrations.
- Load test data in tests, with test-only scripts or a profile.
- Keep seed inserts idempotent-safe or versioned so they run once.
Draft outline details
Demonstration
-- V3__seed_order_status.sql
insert into order_status(code) values ('NEW'), ('PAID'), ('SHIPPED');Check your understanding
Fake demo products: migration or test data?
Show answer
Test data.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.