Improve docs for changing schema
Test Plan: $ diviner . Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3937
This commit is contained in:
@@ -141,14 +141,17 @@ to avoid it if possible.
|
||||
|
||||
There are three simple steps to update the schema:
|
||||
|
||||
- Create a `.sql` file in `resources/sql/patches/`. This file should:
|
||||
# Create a `.sql` file in `resources/sql/patches/`. This file should:
|
||||
- Contain the approprate MySQL commands to update the schema.
|
||||
- Use `${NAMESPACE}` rather than `Phabricator` for database and table names.
|
||||
- Use `${NAMESPACE}` rather than `phabricator` for database names.
|
||||
- Use `COLLATE utf8_bin` for any columns that are to be used as identifiers,
|
||||
such as PHID columns. Otherwise, use `COLLATE utf8_general_ci`.
|
||||
- Edit `src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php` and
|
||||
- Name all indexes so it is possible to delete them later.
|
||||
# Edit `src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php` and
|
||||
add your patch to @{method@phabricator:PhabricatorBuiltinPatchList::getPatches}.
|
||||
- Run `bin/storage/upgrade`.
|
||||
# Run `bin/storage/upgrade`.
|
||||
|
||||
It is also possible to create more complex patch in PHP.
|
||||
|
||||
See the
|
||||
[[https://secure.phabricator.com/rPb39175342dc5bee0c2246b05fa277e76a7e96ed3
|
||||
|
||||
Reference in New Issue
Block a user