I am not able to set foreign key using stephencelis SQLite.swift.
t.foreignKey(user_id, references:"user_mstr",user_id)
I have two tables user_master
and user_details
. How to set user_id
as a foreign key in user_detail
table. I am getting below error.
Cannot invoke foreignkey with an argument list of type (Expression),
You're passing string to references. It should be like
let user_id = Expression<String>("user_id")
let user_mstr = Table("user_mstr")
//cate t somehow
t.foreignKey(user_id, references: user_mstr, user_id)