Foreign key value not getting inserted.. Its blank

I have a schema for user_type
schema “user_type” do
field(:type, :string)
has_many(:roles, Accreditor.Role.Roles, foreign_key: :user_type)

timestamps()

end

def changeset(user_type, attrs) do
user_type
|> cast(attrs, [:type])
|> validate_required([:type])
|> unique_constraint(:type)
end

and have another one roles schema
schema “roles” do
field(:role_name, :string)
#field(:user_type, :id)
has_many(:permissions, Accreditor.Permissions.RolePermissions, foreign_key: :role_id)
belongs_to(:user_type, UserType)

timestamps()

end

@doc false
def changeset(roles, attrs) do
roles
|> cast(attrs, [:role_name])
|> validate_required([:role_name])
|> unique_constraint(:role_name)
end
and iam trying to insert data into roles table,the data role_name get insertedbut the foreign key user_type is blank.
kindly help me with this
These are my postgres tables:
select * from user_type;
id | type | inserted_at | updated_at
----±------±--------------------±--------------------
1 | ADMIN | 2019-05-06 09:19:24 | 2019-05-06 09:19:24
this is my user_type table

select * from roles;
id | role_name | user_type | inserted_at | updated_at
----±----------±----------±--------------------±--------------------
1 | SUPER | | 2019-05-06 09:37:30 | 2019-05-06 09:37:30
and this is my roles table where user_type field is empty. Iam not understanding where iam going wrong.