Browse Source

Run database migrations when necessary

Check the output of the `storage status` command for appearance of
"Not Applied" migrations, and run an upgrade if so. This works
around an earlier assumption that the command would exit nonzero
when there are pending migrations, but it seems to exit zero even
under those conditions.

Change-Id: I5ff8026bfaaf31c8abcd55efc217256605be9e73
changes/95/412595/1
Jeremy Stanley 2 years ago
parent
commit
06bfcaa60e
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      manifests/install.pp

+ 1
- 1
manifests/install.pp View File

@@ -169,7 +169,7 @@ class phabricator::install (
169 169
 
170 170
   exec { 'load-initial-db':
171 171
     command => "${phabricator_dir}/phabricator/bin/storage upgrade --force",
172
-    unless  => "${phabricator_dir}/phabricator/bin/storage status",
172
+    onlyif  => "${phabricator_dir}/phabricator/bin/storage status | grep -q 'Not Applied'",
173 173
     require => [
174 174
       Vcsrepo["${phabricator_dir}/phabricator"],
175 175
       Vcsrepo["${phabricator_dir}/libphutil"],

Loading…
Cancel
Save