Created
September 3, 2017 13:27
-
-
Save sajithdilshan/0c8a81f937293daea76eb28e67b17751 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Test.User do | |
use Test.Web, :model | |
@primary_key {:ID, :id, autogenerate: true} | |
schema "TEST_USERS" do | |
field :NAME, :string | |
belongs_to :TENANT, Test.Tenant, foreign_key: :TENANT_ID, references: :ID | |
many_to_many :GROUPS, Test.Group, join_through: "TEST_GROUPS_USERS", join_keys: [GROUP_ID: :ID, USER_ID: :ID] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment