Schemas and Tables
Learn about the downsides to locking schemas to tables and the advantages of keeping them flexible.
Downsides to locking schemas to tables
When we set up schemas for the first time, it is natural to add fields that exactly match our database tables. However, this can have some unintended side effects down the line. As we’ve seen, schemas become the backbone of our changesets, and changesets are what we use to parse user-submitted data and convey error messages about that data to the user.
For example, the phoenix_ecto
package implements behaviors for the Phoenix web framework such that changesets can be used as the backing data structure for Phoenix forms. To take advantage of the conveniences provided by the Phoenix.Form
module, our web ...