O'Reilly logo

Programming Phoenix by Jose Valim, Bruce Tate, Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required