How to set composite key in Model


#1

I got a bridge table for store pk relationship of two table that has many to many relationship. I want to do something like

class CompanyCourse extends Model {
  static get table() {
    return "tbl_company_course"
  }

  static get primaryKey() {
   // return (`com_id`, `c_id`)
  }
}

#2

Hey @karnphongkie! :wave:

Lucid doesn’t support composite key for the moment.
A new PR is on its way to add it.


#3

Thank you for your reply.
I’m looking forward to a PR come soon