Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #351 from grtjn/322-retired-forests
Browse files Browse the repository at this point in the history
Fixed #322: preserving retired forest at bootstrap
  • Loading branch information
paxtonhare committed Jan 20, 2015
2 parents f0e879b + 86722c6 commit f41e8bf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions deploy/lib/xquery/setup.xqy
Original file line number Diff line number Diff line change
Expand Up @@ -1298,13 +1298,12 @@ declare function setup:attach-database-forest(
let $forest := xdmp:forest($forest-name)
let $admin-config := admin:get-configuration()

(: if the forests are already attached we need to detach them first :)
(: don't detach forests first, they might be retired :)
let $admin-config :=
if (xdmp:database-forests(xdmp:database($database-name))[$forest-name = xdmp:forest-name(.)]) then
admin:database-detach-forest($admin-config, $db, $forest)
else
$admin-config
let $admin-config := admin:database-attach-forest($admin-config, $db, $forest)
else
admin:database-attach-forest($admin-config, $db, $forest)
return
(
if (admin:save-configuration-without-restart($admin-config)) then
Expand Down

0 comments on commit f41e8bf

Please sign in to comment.