<blockquote>
  <p>My dilemma is that for the DB updates to run for Craft, I have to hit visit the control panel and initiate them.</p>
</blockquote>

<p>Currently true, but only if a new database migration has been introduced during the update.  Otherwise, it should be seemless.</p>

<blockquote>
  <p>I need a programmatic solution so that I can ping a URL after the deployment is finished, and initiate the DB updates. Is there already a way to do this...</p>
</blockquote>

<p>It is on our list to add support for an endpoint for deployment services that have a post-deployment hook specifically for situations like this one. (We could use it ourselves!)</p>

CC BY-SA 3.0
2016-06-03T09:05:13.017Z
Hey Brad, has anything like this been introduced as yet?
michaelroper
CC BY-SA 3.0
2016-06-03T20:48:04.443Z
@michaelroper not yet!
Brad Bell
CC BY-SA 3.0
2014-12-31T02:34:46.290Z
2014-12-31T02:34:46.290Z
Brad Bell
<p>When there are updates to Craft, I perform them locally against a local database. The files are then committed to a repository.</p>

<p>I then use Capistrano to deploy the updated installation to various test environments (and eventually production), each of which have their own database.</p>

<p>My dilemma is that for the DB updates to run for Craft, I have to hit visit the control panel and initiate them. I need a programmatic solution so that I can ping a URL after the deployment is finished, and initiate the DB updates.</p>

<p>Is there already a way to do this or do I need to write a plugin that is a wrapper for <code>craft()-&gt;updates-&gt;updateDatabase()</code> that is triggered via a custom site route?</p>

<database><deployment><updates>
DB Update Trigger
# DB Update Trigger

(Asked by: username_0 on 2014-12-31)

When there are updates to Craft, I perform them locally against a local database. The files are then committed to a repository.

I then use Capistrano to deploy the updated installation to various test environments (and eventually production), each of which have their own database.

My dilemma is that for the DB updates to run for Craft, I have to hit visit the control panel and initiate them. I need a programmatic solution so that I can ping a URL after the deployment is finished, and initiate the DB updates.

Is there already a way to do this or do I need to write a plugin that is a wrapper for `craft()->updates->updateDatabase()` that is triggered via a custom site route?

**Tags:** database, deployment, updates

---

## 1 answers

### Answer by username_1 on 2014-12-31. Score: 4

> My dilemma is that for the DB updates to run for Craft, I have to hit visit the control panel and initiate them.

Currently true, but only if a new database migration has been introduced during the update. Otherwise, it should be seemless.

> I need a programmatic solution so that I can ping a URL after the deployment is finished, and initiate the DB updates. Is there already a way to do this...

It is on our list to add support for an endpoint for deployment services that have a post-deployment hook specifically for situations like this one. (We could use it ourselves!)

> **Comments:**
> **username_2**: Hey Brad, has anything like this been introduced as yet?  
> **username_1**: @michaelroper not yet!  

---

