因此,按照在外生文檔的例子,我有以下幾點: defmodule Post do
use Ecto.Schema
schema "posts" do
many_to_many :tags, Tag, join_through: "posts_tags"
end
end
和 defmodule Tag do
use Ecto.Schema
我正在構建一個聊天室應用程序,其中兩個主要模型是User和Room。現在,用戶可以創建新房間以及屬於現有房間。所以我結束了以下模型的房間: defmodule Elemental.TxChat.Room do
use Elemental.TxChat.Web, :model
schema "rooms" do
field :name, :string
fi
我有我在與同時使用的變更問題,以下型號(聊天室): defmodule Elemental.TxChat.Room do
use Elemental.TxChat.Web, :model
schema "rooms" do
field :name, :string
# Foreign key indicating which user created t
客戶端發送以下JSON:{ 「用戶」:{ 「年齡+」:18日, 「時代 - 」:40}} 在我的控制器我有以下幾點: def procura(conn, query) do
maior = conn.params["user"]["age+"]
menor = conn.params["user"]["age-"]
query = from u in query, where
我工作的多用戶創建多對多關聯,多房間聊天應用,爲此,我的模型如下(在App模式已經爲簡單起見,省略): defmodule Elemental.TxChat.User do
use Elemental.TxChat.Web, :model
schema "users" do
# The rooms the user is currenly logged into
我有一個簡單的模型: schema "torrents" do
field :name, :string
field :magnet, :string
field :leechers, :integer
field :seeders, :integer
field :source, :string
field :filesize, :st