Skip to content
Ameen Abozaid
Planned lessonJNR-033-L04

Seed data

  • Lesson 4 of 6
  • Junior
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

sql
-- 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.