I am trying to create a rest API. I have already a database. I want to create a struct linked to a database table. But when I run the project beego automatically creates an "id" primary key for the model registered. How to avoid this in beego?
My code example:
Model:
type Person struct {
PersonId string `json:"person_id"`
name string `json:"name"`
email string `json:"email"`
}
Problem: Encounter need a primary key field when using beego It creates an id field in db table with default null value.
Note: person_id is the primary key in person table.