I'm new to PostgreSQL. I have problem in association between parent and child. Let say we have two schemas called TableA and TableB. I need to associate TableA and TableB. In which the primary key of TableA, may or may not be needed in TableB for "specific roles"(I have three roles called E,F and G. For G I do not need an entry in TableB but I need it for rest of the roles). How do I associate. Which association do I need to use, Whether has_many, has_one etc, is there any way to fix this. You may find the link here Ecto Schema
TableA Schema
schema "TableA" do
field :name, :string
field :role, :string
field :status, :string
timestamps()
end
TableB Schema
schema "TableB" do
field :address1, :string
field :address2, :string
field :city, :string
field :companyname, :string
field :contactno, :string
field :country, :string
field :email, :string
field :mobileno, :string
field :state, :string
field :status, :string
field :type, :string
field :zipcode, :string
timestamps()
end