Created
June 7, 2018 21:04
-
-
Save Cibernomadas/3cac49105ac996d01541bbe007d29de4 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
package models | |
import "github.com/jinzhu/gorm" | |
type User struct { | |
gorm.Model | |
Username string `gorm:"type:varchar(32);UNIQUE"` | |
Email string `gorm:"type:varchar(256);UNIQUE"` | |
Password string `gorm:"type:varchar(128)"` | |
} | |
type Post struct { | |
gorm.Model | |
UserID int | |
User User | |
Body string `gorm:"type:varchar(512)"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment