Files
Repuestera/back/models/marca.go
T

21 lines
519 B
Go

package models
import (
"time"
"gorm.io/gorm"
)
type Marca struct {
ID string `gorm:"primaryKey;type:varchar(3)" json:"id"`
Nombre string `gorm:"uniqueIndex;not null;type:varchar(70)" json:"nombre"`
Repuestos []Repuesto `gorm:"foreignKey:MarcaID"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
func (Marca) TableName() string {
return "marca"
}