Created
July 24, 2018 15:20
-
-
Save Cibernomadas/f9f273f19bc841ff15038f6cae4c316f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User struct { | |
gorm.Model | |
UserSession | |
Username string `gorm:"type:varchar(32);UNIQUE"` | |
Email string `gorm:"type:varchar(256);UNIQUE"` | |
Password string `gorm:"type:varchar(128)"` | |
AboutMe string `gorm:"type:varchar(512)"` | |
LastSeen string `gorm:"type:varchar(20)"` | |
Followers []*User `gorm:"many2many:followship;association_jointable_foreignkey:follower_id;jointable_foreignkey:followed_id"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment