From 1cebe9b8b97388826558355c293f29082a35d2f3 Mon Sep 17 00:00:00 2001 From: marun <35883111+run6@users.noreply.github.com> Date: Sun, 19 May 2019 14:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=B8=BB=E9=94=AE?= =?UTF-8?q?=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/05.5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh/05.5.md b/zh/05.5.md index 8eefa632..f945d623 100644 --- a/zh/05.5.md +++ b/zh/05.5.md @@ -184,14 +184,14 @@ orm.SetMaxOpenConns("default", 30) ```Go type Userinfo struct { - Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 + Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 Username string Departname string Created time.Time } type User struct { - Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 + Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 Name string Profile *Profile `orm:"rel(one)"` // OneToOne relation Post []*Post `orm:"reverse(many)"` // 设置一对多的反向关系