Estudiante.go 515 B

1234567891011121314
  1. package models
  2. import "gorm.io/gorm"
  3. type Estudiante struct {
  4. gorm.Model
  5. Nombre string `gorm:"not null" json:"nombre"`
  6. ApellidoP string `gorm:"not null" json:"apellido_p"`
  7. ApellidoM string `gorm:"not null" json:"apellido_m"`
  8. Sexo string `gorm:"not null" json:"sexo"`
  9. FechaN string `gorm:"not null" json:"fecha_n"`
  10. CategoriaID uint `json:"categoria_id"` // Field to store
  11. Categoria Categoria `gorm:"foreignKey:CategoriaID"` // Relation with Attribute
  12. }