craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.21k stars 624 forks source link

Add method to programatically to run DB migration + schema update #1907

Closed Firefishy closed 6 years ago

Firefishy commented 7 years ago

Description

Currently there seems to be no way to programatically or automatically run a DB migration / schema updates.

Steps to reproduce

  1. Install and configure Craft v2.6.2978
  2. http://example.com/ works. HTTP 200.
  3. Replace files with Craft v2.6.2988
  4. http://example.com/ fails with HTTP 503.
  5. Run: yiic migrations up
  6. http://example.com/ still fails with HTTP 503. All migrations have run, but DB craft_info.schemaVersion is mismatched.
  7. http://example.com/admin/ click Update.
  8. http://example.com/ works. HTTP 200.

After Step 5 (or using another method) the site should load HTTP 200. In reality step 3 is by replacing the app container with a new container with the new version.

Additional info

brandonkelly commented 7 years ago

Agree that it is weird that running migrate up from the command line will not update the app/plugin schema version once it's done.

hiasl commented 6 years ago

+1 for Craft3: Please provide a command for this last step, otherwise it's hard to do it via Jenkins