Page MenuHomePhabricator

When initializing a new database, just apply adjustments without prompting
Closed, ResolvedPublic

Description

When you bin/storage upgrade the first time, we often have adjustments to apply because we've changed keys or column types by adjusting the authority in PHP and letting the adjustment process fix the database.

Currently, we prompt you to apply them. This isn't really a useful prompt if we just initialized storage.

$ ./bin/storage upgrade --namespace breaddog
Before running storage upgrades, you should take down the Phabricator web
interface and stop any running Phabricator daemons (you can disable this
warning with --force).

    Are you ready to continue? [y/N] y

...<snip many patches>...

Database              Table                    Name              Issues
breaddog_calendar     calendar_event           userPHID_dateFrom Surplus Key
breaddog_calendar     calendar_event           key_date          Missing Key
breaddog_file         file_transaction_comment key_draft         Surplus Key
breaddog_harbormaster harbormaster_build       key_initiator     Missing Key
breaddog_herald       herald_rule              name              Better Collation Available
breaddog_herald       herald_rule              key_name          Missing Key
breaddog_instances    instances_instance       key_account       Missing Key
breaddog_instances    instances_instance       key_oauth         Missing Key
breaddog_ledger       ledger_account           key_phid          Missing Key
breaddog_ledger       ledger_merchant          key_phid          Missing Key
breaddog_ledger       ledger_payment           key_phid          Missing Key
breaddog_packages     packages_package         name              Better Collation Available
breaddog_packages     packages_publisher       name              Better Collation Available
breaddog_search       search_document          key_type          Missing Key
breaddog_worker       worker_archivetask       key_modified      Missing Key

Found 15 issues(s) with schemata, detailed above.

You can review issues in more detail from the web interface, in Config > Database Status. To better understand the adjustment workflow, see "Managing Storage Adjustments" in the documentation.

MySQL needs to copy table data to make some adjustments, so these migrations may take some time.


    Fix these schema issues? [y/N] 

We could reasonably just --force these to apply, and/or make the help text a little more reassuring for first-time users.