Wrapping Up

In this chapter, we generated a Video resource with a relationship to User and made changes to the generated code, learning a lot along the way:

  • We converted a private plug into a public function and shared it with our controllers and routers.

  • You learned how to migrate and roll back changes to the database.

  • We defined relationships between User and Video schemas and used functions from Ecto to build and retrieve associated data.

  • You learned that Ecto uses strictly explicit semantics to determine if a relationship is loaded or not.

The next chapter will take everything up a notch by exploring Ecto queries and leveraging the database constraints. When we’re done, you’ll be able to ensure data uniqueness and use the database to maintain ...

Get Programming Phoenix now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.