mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +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
|
@ -27,7 +27,7 @@ import (
|
|||
// Store provides data access to space category information.
|
||||
type Store struct {
|
||||
store.Context
|
||||
domain.LinkStorer
|
||||
store.LinkStorer
|
||||
}
|
||||
|
||||
// Add inserts wiki-link into the store.
|
||||
|
@ -94,7 +94,7 @@ func (s Store) GetPageLinks(ctx domain.RequestContext, documentID, pageID string
|
|||
func (s Store) MarkOrphanDocumentLink(ctx domain.RequestContext, documentID string) (err error) {
|
||||
revised := time.Now().UTC()
|
||||
_, err = ctx.Transaction.Exec(s.Bind(`UPDATE dmz_doc_link SET
|
||||
c_orphan=1, c_revised=?
|
||||
c_orphan=true, c_revised=?
|
||||
WHERE c_type='document' AND c_orgid=? AND c_targetdocid=?`),
|
||||
revised, ctx.OrgID, documentID)
|
||||
|
||||
|
@ -109,7 +109,7 @@ func (s Store) MarkOrphanDocumentLink(ctx domain.RequestContext, documentID stri
|
|||
func (s Store) MarkOrphanPageLink(ctx domain.RequestContext, pageID string) (err error) {
|
||||
revised := time.Now().UTC()
|
||||
_, err = ctx.Transaction.Exec(s.Bind(`UPDATE dmz_doc_link SET
|
||||
c_orphan=1, c_revised=?
|
||||
c_orphan=true, c_revised=?
|
||||
WHERE c_type='section' AND c_orgid=? AND c_targetid=?`),
|
||||
revised, ctx.OrgID, pageID)
|
||||
|
||||
|
@ -124,7 +124,7 @@ func (s Store) MarkOrphanPageLink(ctx domain.RequestContext, pageID string) (err
|
|||
func (s Store) MarkOrphanAttachmentLink(ctx domain.RequestContext, attachmentID string) (err error) {
|
||||
revised := time.Now().UTC()
|
||||
_, err = ctx.Transaction.Exec(s.Bind(`UPDATE dmz_doc_link SET
|
||||
c_orphan=1, c_revised=?
|
||||
c_orphan=true, c_revised=?
|
||||
WHERE c_type='file' AND c_orgid=? AND c_targetid=?`),
|
||||
revised, ctx.OrgID, attachmentID)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue