I have this structure:
type User struct {
ID int
CreatedAt int
UpdatedAt int
DeviceUniqueIdentifier string
Sessions []Session `has_many:"sessions"`
}
I have no idea how to export this in fizz, so I did so:
buffalo pop generate model User
To my surprise, it actually generated a User and put a table in the database, but neither the table nor the structure are as expected.
Here is the new User struct:
...
type User struct {
ID uuid.UUID `json:"id" db:"id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
...
Is there any way to generate passing some fields? Or is there a way to convert the structure to a table automatically?