Hacker News new | ask | show | jobs
by dnautics 2 days ago
automatic migrations terrifies me. i use elixir/ecto. just write a migration!

besides, some times you might want more than one schema for a db table (e.g. one with minimal information, for menus, dropdowns etc, and one with full information for your full CRUD operations)

1 comments

> some times you might want more than one schema for a db table

Django has the concept of "proxy models" where you can define a trimmed down model for the same database table.

what if two models access disjoint sets of fields (like a Data.Admin and Data.User)
Two proxy models that extend the same base model.