Add postgresql support (#792)

* use false for bool type

Signed-off-by: ChangFeng <chang_196700@hotmail.com>

* use `limit ? offset ?` instead limit ?,? for database compatibility

Signed-off-by: ChangFeng <chang_196700@hotmail.com>

* add postgresql support

Signed-off-by: ChangFeng <chang_196700@hotmail.com>

* add postgres options and descriptions

Signed-off-by: ChangFeng <chang_196700@hotmail.com>

---------

close #791

Signed-off-by: ChangFeng <chang_196700@hotmail.com>
Co-authored-by: 玖亖伍 <gsw945@foxmail.com>
This commit is contained in:
Feng Chang
2023-04-14 11:09:53 +08:00
committed by GitHub
parent bc4cfdbbe6
commit 8b57c6aaf0
9 changed files with 61 additions and 30 deletions

View File

@@ -12,10 +12,10 @@ import (
//团队.
type Team struct {
TeamId int `orm:"column(team_id);pk;auto;unique;" json:"team_id"`
TeamName string `orm:"column(team_name);size(255);description(团队名称)" json:"team_name"`
MemberId int `orm:"column(member_id);type(int);description(创建人id)" json:"member_id"`
IsDelete bool `orm:"column(is_delete);default(0);description(是否删除 0否 1:是)" json:"is_delete"`
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;description(创建时间)" json:"create_time"`
TeamName string `orm:"column(team_name);size(255);description(团队名称)" json:"team_name"`
MemberId int `orm:"column(member_id);type(int);description(创建人id)" json:"member_id"`
IsDelete bool `orm:"column(is_delete);default(false);description(是否删除 false否 true:是)" json:"is_delete"`
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;description(创建时间)" json:"create_time"`
MemberCount int `orm:"-" json:"member_count"`
BookCount int `orm:"-" json:"book_count"`
MemberName string `orm:"-" json:"member_name"`