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
44a1c869
Commit
44a1c869
authored
Oct 26, 2019
by
AchimHentschel
Committed by
Nicolas Giard
Oct 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: MSSQL - adds IDENTITY_INSERT in rebuild-tree.js #1125 (#1130)
Fixes issue when tree is being rebuilt with mssql backend
parent
8000ebec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
rebuild-tree.js
server/jobs/rebuild-tree.js
+10
-1
No files found.
server/jobs/rebuild-tree.js
View file @
44a1c869
...
...
@@ -53,7 +53,16 @@ module.exports = async (pageId) => {
await
WIKI
.
models
.
knex
.
table
(
'pageTree'
).
truncate
()
if
(
tree
.
length
>
0
)
{
await
WIKI
.
models
.
knex
.
table
(
'pageTree'
).
insert
(
tree
)
const
{
bindings
,
sql
}
=
WIKI
.
models
.
knex
.
table
(
'pageTree'
).
insert
(
tree
).
toSQL
();
if
(
WIKI
.
config
.
db
.
type
===
'mssql'
)
{
await
WIKI
.
models
.
knex
.
raw
(
sql
,
bindings
).
wrap
(
'SET IDENTITY_INSERT pageTree ON;'
,
'SET IDENTITY_INSERT pageTree OFF;'
,
)
}
else
{
await
WIKI
.
models
.
knex
.
raw
(
sql
,
bindings
)
}
// await WIKI.models.knex.table('pageTree').insert(tree)
}
await
WIKI
.
models
.
knex
.
destroy
()
...
...
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