mirror of
https://github.com/documize/community.git
synced 2025-08-05 13:35:25 +02:00
Continued MySQL/PostgreSQL store provider refactoring
Refactored, renamed, removed storage related code. Basic smoke test passed for PostgreSQL whilst fully working on MySQL variants as per usual.
This commit is contained in:
parent
b455e5eaf5
commit
97beb3f4d3
81 changed files with 1454 additions and 1497 deletions
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/documize/community/core/uniqueid"
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/permission"
|
||||
"github.com/documize/community/domain/store"
|
||||
"github.com/documize/community/model/audit"
|
||||
"github.com/documize/community/model/category"
|
||||
pm "github.com/documize/community/model/permission"
|
||||
|
@ -34,7 +35,7 @@ import (
|
|||
// Handler contains the runtime information such as logging and database.
|
||||
type Handler struct {
|
||||
Runtime *env.Runtime
|
||||
Store *domain.Store
|
||||
Store *store.Store
|
||||
}
|
||||
|
||||
// Add saves space category.
|
||||
|
|
|
@ -25,7 +25,7 @@ import (
|
|||
// Store provides data access to space category information.
|
||||
type Store struct {
|
||||
store.Context
|
||||
domain.CategoryStorer
|
||||
store.CategoryStorer
|
||||
}
|
||||
|
||||
// Add inserts the given record into the category table.
|
||||
|
@ -220,13 +220,13 @@ func (s Store) GetSpaceCategorySummary(ctx domain.RequestContext, spaceID string
|
|||
AND c_docid IN (
|
||||
SELECT c_refid
|
||||
FROM dmz_doc
|
||||
WHERE c_orgid=? AND c_spaceid=? AND c_lifecycle!=2 AND c_template=0 AND c_groupid=''
|
||||
WHERE c_orgid=? AND c_spaceid=? AND c_lifecycle!=2 AND c_template=false AND c_groupid=''
|
||||
UNION ALL
|
||||
SELECT d.c_refid
|
||||
FROM (
|
||||
SELECT c_groupid, MIN(c_versionorder) AS latestversion
|
||||
FROM dmz_doc
|
||||
WHERE c_orgid=? AND c_spaceid=? AND c_lifecycle!=2 AND c_groupid!='' AND c_template=0
|
||||
WHERE c_orgid=? AND c_spaceid=? AND c_lifecycle!=2 AND c_groupid!='' AND c_template=false
|
||||
GROUP BY c_groupid
|
||||
) AS x INNER JOIN dmz_doc AS d ON d.c_groupid=x.c_groupid AND d.c_versionorder=x.latestversion
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue