Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
da86d8cc
Commit
da86d8cc
authored
Jan 26, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: objection.js 2.0 compat fixes
parent
8f526562
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
system.js
server/graph/resolvers/system.js
+6
-6
pages.js
server/models/pages.js
+4
-4
No files found.
server/graph/resolvers/system.js
View file @
da86d8cc
...
...
@@ -362,16 +362,16 @@ module.exports = {
return
process
.
cwd
()
},
async
groupsTotal
()
{
const
total
=
await
WIKI
.
models
.
groups
.
query
().
count
(
'* as total'
).
first
()
.
pluck
(
'total'
)
return
_
.
toSafeInteger
(
total
)
const
total
=
await
WIKI
.
models
.
groups
.
query
().
count
(
'* as total'
).
first
()
return
_
.
toSafeInteger
(
total
.
total
)
},
async
pagesTotal
()
{
const
total
=
await
WIKI
.
models
.
pages
.
query
().
count
(
'* as total'
).
first
()
.
pluck
(
'total'
)
return
_
.
toSafeInteger
(
total
)
const
total
=
await
WIKI
.
models
.
pages
.
query
().
count
(
'* as total'
).
first
()
return
_
.
toSafeInteger
(
total
.
total
)
},
async
usersTotal
()
{
const
total
=
await
WIKI
.
models
.
users
.
query
().
count
(
'* as total'
).
first
()
.
pluck
(
'total'
)
return
_
.
toSafeInteger
(
total
)
const
total
=
await
WIKI
.
models
.
users
.
query
().
count
(
'* as total'
).
first
()
return
_
.
toSafeInteger
(
total
.
total
)
}
}
}
server/models/pages.js
View file @
da86d8cc
...
...
@@ -570,7 +570,7 @@ module.exports = class Page extends Model {
let
affectedHashes
=
[]
// -> Perform replace and return affected page hashes (POSTGRES only)
if
(
WIKI
.
config
.
db
.
type
===
'postgres'
)
{
affected
Hashes
=
await
WIKI
.
models
.
pages
.
query
()
const
qry
Hashes
=
await
WIKI
.
models
.
pages
.
query
()
.
returning
(
'hash'
)
.
patch
({
render
:
WIKI
.
models
.
knex
.
raw
(
'REPLACE(??, ?, ?)'
,
[
'render'
,
replaceArgs
.
from
,
replaceArgs
.
to
])
...
...
@@ -581,7 +581,7 @@ module.exports = class Page extends Model {
'pageLinks.localeCode'
:
opts
.
locale
})
})
.
pluck
(
'hash'
)
affectedHashes
=
qryHashes
.
map
(
h
=>
h
.
hash
)
}
else
{
// -> Perform replace, then query affected page hashes (MYSQL, MARIADB, MSSQL, SQLITE only)
await
WIKI
.
models
.
pages
.
query
()
...
...
@@ -594,7 +594,7 @@ module.exports = class Page extends Model {
'pageLinks.localeCode'
:
opts
.
locale
})
})
affected
Hashes
=
await
WIKI
.
models
.
pages
.
query
()
const
qry
Hashes
=
await
WIKI
.
models
.
pages
.
query
()
.
column
(
'hash'
)
.
whereIn
(
'pages.id'
,
function
()
{
this
.
select
(
'pageLinks.pageId'
).
from
(
'pageLinks'
).
where
({
...
...
@@ -602,7 +602,7 @@ module.exports = class Page extends Model {
'pageLinks.localeCode'
:
opts
.
locale
})
})
.
pluck
(
'hash'
)
affectedHashes
=
qryHashes
.
map
(
h
=>
h
.
hash
)
}
for
(
const
hash
of
affectedHashes
)
{
await
WIKI
.
models
.
pages
.
deletePageFromCache
({
hash
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment