Answers.Body: <p>You can use <a href="http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#applying-migrations" rel="noreferrer">Yii's migrate console command</a>.</p>
  
  <p>Triggered in Craft 3 via <code>craft migrate --type=app</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-13T10:16:25.397Z
Answers.Text: And just to make sure: nothing else is done in this (normally) manual step than applying the Yii migrations?
Answers.UserDisplayName: Matthias Redl-Mann
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-13T22:42:15.847Z
Answers.Text: Correct... the updater uses the same logic
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-13T09:19:16.710Z
Answers.Text: I just had the change to try it, but it does not work. The website itself currently gives me a 503 "Service unavailable", under /admin/ I get "To complete the update, some changes must be made to your database."
Answers.UserDisplayName: Matthias Redl-Mann
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-13T09:57:33.410Z
Answers.Text: ...
  But the manual "craft migrate" still tells me "No new migrations found. Your system is up-to-date."
  
  I also tried setting the migration path via "./craft migrate --migrationPath=@vendor/craftcms/cms/src/migrations --interactive=0". Still "no new migrations found":
  
  Any ideas?
Answers.UserDisplayName: Matthias Redl-Mann
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-13T18:04:14.970Z
Answers.Text: My bad... by default it queries for site migrations.  Add the `--type=app` to tell it to look at Craft migrations.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-14T10:24:03.580Z
Answers.Text: OK, Migrations work that way, but the 503 does not get removed (although it does not seem to be caused by the "maintenance" column in the "info" table (which is 0). You still need to press the button under /admin/ (wich will also causes an update to the version column in the "info" table to the current version). So pressing the button in the backend seems to do more than the migrations. Could you provide a command for the whole thing? Because an automation to that is really valuable.
Answers.UserDisplayName: Matthias Redl-Mann
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-14T21:55:36.123Z
Answers.Text: Agree, it'd be useful. Looks like there is already an FR for this: https://github.com/craftcms/cms/issues/1907
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-11T17:21:31.320Z
Answers.LastActivityDate: 2017-11-13T18:03:44.920Z
Answers.LastEditDate: 2017-11-13T18:03:44.920Z
Answers.UserDisplayName: Brad Bell
Body: <p>Is there any craft command command (shell) which can be used to perform the database updates necessary after a CMS update? (e.g. Craft3 beta-28 to beta29 or multi version updates)</p>
  
  <p>Background: We are deploying our projects with Jenkins and I would want Jenkins to call such a command after each deployment (or after each CMS update). Going to the /admin/ Panel manually to be told that the database needs to be upgraded is not ideal.</p>
  
Tags: <database><craft3><migration><updates>
Title: Craft 3: Update database after CMS upgrade via console command
ThreadText: # Craft 3: Update database after CMS upgrade via console command
  
  (Asked by: username_0 on 2017-10-11)
  
  Is there any craft command command (shell) which can be used to perform the database updates necessary after a CMS update? (e.g. Craft3 beta-28 to beta29 or multi version updates)
  
  Background: We are deploying our projects with Jenkins and I would want Jenkins to call such a command after each deployment (or after each CMS update). Going to the /admin/ Panel manually to be told that the database needs to be upgraded is not ideal.
  
  **Tags:** database, craft3, migration, updates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-11. Score: 7 | Accepted answer
  
  You can use [Yii's migrate console command](http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#applying-migrations).
  
  Triggered in Craft 3 via `craft migrate --type=app`.
  
  > **Comments:**
  > **username_0**: And just to make sure: nothing else is done in this (normally) manual step than applying the Yii migrations?  
  > **username_1**: Correct... the updater uses the same logic  
  > **username_0**: I just had the change to try it, but it does not work. The website itself currently gives me a 503 "Service unavailable", under /admin/ I get "To complete the update, some changes must be made to your database."  
  > **username_0**: ... But the manual "craft migrate" still tells me "No new migrations found. Your system is up-to-date."  I also tried setting the migration path via "./craft migrate --migrationPath=@vendor/craftcms/cms/src/migrations --interactive=0". Still "no new migrations found":  Any ideas?  
  > **username_1**: My bad... by default it queries for site migrations.  Add the `--type=app` to tell it to look at Craft migrations.  
  > **username_0**: OK, Migrations work that way, but the 503 does not get removed (although it does not seem to be caused by the "maintenance" column in the "info" table (which is 0). You still need to press the button under /admin/ (wich will also causes an update to the version column in the "info" table to the current version). So pressing the button in the backend seems to do more than the migrations. Could you provide a command for the whole thing? Because an automation to that is really valuable.  
  > **username_1**: Agree, it'd be useful. Looks like there is already an FR for this: https://github.com/craftcms/cms/issues/1907  
  
  ---
  
  