rideaware-api/models/user_profile.go
Cipher Vance 3ed698918b feat: add Go models for User and UserProfile
- Create models/user.go with bcrypt password hashing
- Create models/user_profile.go with foreign key relationship
- Add GORM hooks for automatic profile creation
- Include proper JSON tags and database constraints
2025-09-18 20:06:36 -05:00

12 lines
465 B
Go

package models
type UserProfile struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null" json:"user_id"`
FirstName string `gorm:"size:80;not null" json:"first_name"`
LastName string `gorm:"size:80;not null" json:"last_name"`
Bio string `gorm:"type:text" json:"bio"`
ProfilePicture string `gorm:"size:255" json:"profile_picture"`
User *User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}