-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev docs: Add guidelines on how to use migrations, upgrade and initdb
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _initial-data-and-upgrade: | ||
|
||
Initial data and upgrade | ||
======================== | ||
|
||
When developing is not uncommon to have to alter the database schema (adding, | ||
changing or removing fields to models), provide new initial data on fresh | ||
installations or alter the data on the database when upgrading. | ||
|
||
The following guidelines are meant to make clear where to put the code: | ||
|
||
- When altering the database schema, add a migration. | ||
- When adding new initial data, add the code to ``pootle.core.initdb``. | ||
- When altering the data on the database on upgrading, add the code to | ||
``pootle.apps.pootle_misc.upgrade.pootle``. | ||
|
||
.. note:: If this upgrade code is going to be used for providing initial data | ||
as well, then it must be placed instead on ``pootle.core.initdb`` and | ||
referenced from ``pootle.apps.pootle_misc.upgrade.pootle``. |