# How do you model different ‘types’ with totally different fields in Ecto?

**URL:** <https://forum.elixirforum.com/t/how-do-you-model-different-types-with-totally-different-fields-in-ecto/74944>\
**Category:** Questions\
**Tags:** ecto, database\
**Created:** [April 8, 2026, 5:36pm UTC](https://forum.elixirforum.com/t/how-do-you-model-different-types-with-totally-different-fields-in-ecto/74944 "2026-04-08T17:36:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![LostKobrakai](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/32/3072_2.png) [@LostKobrakai](https://forum.elixirforum.com/u/LostKobrakai)\
**Post date:** [April 8, 2026, 7:13pm UTC](https://forum.elixirforum.com/t/how-do-you-model-different-types-with-totally-different-fields-in-ecto/74944/5 "2026-04-08T19:13:22Z")

</div>

I recently read a good blog post on this:

> **[Subtypes and status-dependent data: pure relational approach](https://minimalmodeling.substack.com/p/subtypes-and-status-dependent-data)**
>
> Using constant columns to solve a common problem of encoding status-dependent information (or subtypes, more generally).

This is about the plain db level. Once you have that you can add the schemas for that.

You likely want to have another layer of this eventually, which can map between `[ItemA, ItemB]` to those lower level nested schemas.

---

_[View the full topic](https://forum.elixirforum.com/t/how-do-you-model-different-types-with-totally-different-fields-in-ecto/74944)._
