diff --git a/domain/permission/mysql/store.go b/domain/permission/mysql/store.go index 5037e72c..128df6f0 100644 --- a/domain/permission/mysql/store.go +++ b/domain/permission/mysql/store.go @@ -246,7 +246,7 @@ func (s Scope) GetDocumentPermissions(ctx domain.RequestContext, documentID stri FROM dmz_permission WHERE c_orgid=? AND c_location='document' AND c_refid=? AND c_who='user' UNION ALL - SELECT id, p.c_orgid AS orgid, p.c_who AS who, p.c_whoid AS whoid, p.c_action AS action, p.c_scope AS scope, p.c_location AS location, p.c_refid AS refid + SELECT p.id, p.c_orgid AS orgid, p.c_who AS who, p.c_whoid AS whoid, p.c_action AS action, p.c_scope AS scope, p.c_location AS location, p.c_refid AS refid FROM dmz_permission p LEFT JOIN dmz_group_member r ON p.c_whoid=r.c_groupid WHERE p.c_orgid=? AND p.c_location='document' AND p.c_refid=? AND p.c_who='role'`, @@ -267,7 +267,7 @@ func (s Scope) GetDocumentPermissions(ctx domain.RequestContext, documentID stri func (s Scope) DeleteDocumentPermissions(ctx domain.RequestContext, documentID string) (rows int64, err error) { b := mysql.BaseQuery{} - sql := fmt.Sprintf("DELETE FROM dmz_permission WHERE c_orgid='%s' AND location='document' AND c_refid='%s'", ctx.OrgID, documentID) + sql := fmt.Sprintf("DELETE FROM dmz_permission WHERE c_orgid='%s' AND c_location='document' AND c_refid='%s'", ctx.OrgID, documentID) return b.DeleteWhere(ctx.Transaction, sql) } diff --git a/domain/user/mysql/store.go b/domain/user/mysql/store.go index a8df70bd..7c7955f7 100644 --- a/domain/user/mysql/store.go +++ b/domain/user/mysql/store.go @@ -309,7 +309,7 @@ func (s Scope) ForgotUserPassword(ctx domain.RequestContext, email, token string // CountActiveUsers returns the number of active users in the system. func (s Scope) CountActiveUsers() (c int) { - row := s.Runtime.Db.QueryRow("SELECT count(*) FROM dmz_user WHERE c_refid IN (SELECT c_userid FROM dmz_user_account WHERE active=1)") + row := s.Runtime.Db.QueryRow("SELECT count(*) FROM dmz_user WHERE c_refid IN (SELECT c_userid FROM dmz_user_account WHERE c_active=1)") err := row.Scan(&c) if err == sql.ErrNoRows { diff --git a/edition/boot/runtime.go b/edition/boot/runtime.go index 06dc0ce5..4bba21a3 100644 --- a/edition/boot/runtime.go +++ b/edition/boot/runtime.go @@ -55,7 +55,7 @@ func InitRuntime(r *env.Runtime, s *domain.Store) bool { storage.SetMySQLProvider(r, s) case "percona": storage.SetMySQLProvider(r, s) - case "pggg": + case "postgres": // storage.SetPostgresSQLProvider(r, s) case "mssql": // storage.SetSQLServerProvider(r, s)