You are browsing a read-only backup copy of Wikitech. The live site can be found at

What is a database schema change/workflow

From Wikitech-static
< What is a database schema change
Revision as of 08:35, 28 February 2019 by imported>Jcrespo (style)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Workflow for requesting a database schema change

The following is a step-by-step instruction guide to requesting database schema changes from the DBAs (part of the SRE team in the Technology Department)

How to request a database schema change

  1. Create a Phabricator task with the #schema-change tag to propose a change to a table’s design.
  2. Add in relevant people that would need to see this request in order to provide constructive feedback in a timely manner.
    • As needed, add tags #dba, #core_platform_team_backlog, #analytics and #dumps-generation to your ticket
  3. Have a conversation (usually on the Phabricator task, but occasionally a meeting or two will be needed) by the developers and engineers to agree on what is to be done, you’ll need to create an additional task ticket that will have the exact details of the changes that are needed.
  4. Create this new ticket as a subtask of the original Phabricator task:
    • Add applicable tags, such as: #dba, #core_platform_team_backlog, #analytics, #schema-change and #dumps-generation
    • FYI: #blocked-on-schema-change is only used once you are actually blocked
  5. Provide the specific information that is needed (each batch group will have its own ticket, even if the alters are done at the same time):
    1. The ALTER TABLEs to run (link to a commit diff)
    2. Where to apply the schema changes (a specific dblist file or complete list of wikis)
    3. When to apply the schema changes
      • If it depends on a particular code deployment; if it can be done at any time or; if it needs to be done by a certain future date
  6. Confirm that the schema change is backwards compatible
    • If it is compatible with current code and, if it can be completed at any time
  7. Confirm that the schema change has been tested
    • On a test or beta wiki (Note: ss a last test, the change can be applied to testwiki before going into production)
  8. Confirm that the data should be made available on lab replicas and/or dumps:
    • If the schema change involves new columns or tables; if the data contains private or sensitive data (consult legal if you are unsure); and if it involves deletion of data that was previously available on labs

Want specific examples and more background information on making database schema changes?

Click here for more detailed information.