TracksMastering Content OperationsCoursesHandling schema changes confidently

Handling schema changes confidently

Knut Melvær
Knut MelværHead of Developer Community and Education
Last updated 1 day ago
9
Lessons

Expertly navigate schema changes, validate datasets, and execute content migrations using tools like the Sanity CLI and GROQ queries.

1. Introduction to Schema Change Management

2
Tasks

How to think about schema change management and preparing your project for this course's exercises.

2. Validating documents in bulk

1
Task

Check document validation status across a whole dataset. Update schema with missing fields for content that's found in the dataset's documents.

3. Changing a field name

2
Tasks

Rename fields by first deprecating existing ones and marking them read only

4. Adapting a front end without downtime

3
Tasks

Prepare a front end for down-time-less content migration by adapting a GROQ query with fallbacks

5. Writing a content migration

7
Tasks

Use Sanity CLI to create a new content migration. Adapt the migration script for your use case.

6. Running a content migration

6
Tasks

Use field validation to validate if the migration was successful. Back up the dataset for safe measure. Run the content migration and verify that it went well.

7. Tidy up the schema and front end code

3
Tasks

Tidy up the document form by hiding the old field. Update your front end to only query and access the new field name.

8. Making the content migration (more) idempotent

1
Task

Make it safe(r) to run the content migration multiple times using GROQ filters and idempotency keys.

9. Schema Change Management Quiz