Phoenix 框架:如何使用 phoenix.gen 任务生成具有类型列表列的 Ecto 模型?

Phoenix framework: how to generate an Ecto model with columns of type list with a phoenix.gen task?

我想生成一个 Ecto model with columns of type list,像这样:

...
users: [
  %{
    id: 1
  },
  %{
    id: 2
  }
]
...

使用 phoenix.gen 任务。你能帮帮我吗?

看来您真正想要的是has_many关系。对吗?

如果是这样,您可能想查看 this blog post,其中解释了 Phoenix 是如何做到这一点的。