summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-08-07 19:36:58 +0000
committerGerrit Code Review <review@openstack.org>2013-08-07 19:36:58 +0000
commitc547eb41097c86a41b6165088423df71b6ff7e01 (patch)
tree47b03728bdfc013ad870674100c527e14ae3c01e /doc
parentdb9535cfb46db4a4f3a7fdb565ea9be4db2a9ef6 (diff)
parent10ef682f46e34e4e19d467c9b0e45f4f8838a134 (diff)
downloadkeystone-c547eb41097c86a41b6165088423df71b6ff7e01.tar.gz
keystone-c547eb41097c86a41b6165088423df71b6ff7e01.tar.xz
keystone-c547eb41097c86a41b6165088423df71b6ff7e01.zip
Merge "extension migrations"
Diffstat (limited to 'doc')
-rw-r--r--doc/source/developing.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/source/developing.rst b/doc/source/developing.rst
index c14ef7ab..2cf4b98e 100644
--- a/doc/source/developing.rst
+++ b/doc/source/developing.rst
@@ -71,6 +71,36 @@ place::
.. _`python-keystoneclient`: https://github.com/openstack/python-keystoneclient
+Database Schema Migrations
+--------------------------
+
+Keystone uses SQLAlchemy-migrate
+_`SQLAlchemy-migrate`:http://code.google.com/p/sqlalchemy-migrate/ to migrate the SQL database
+between revisions. For core components, the migrations are kept in a central
+repository under keystone/common/sql/migrate_repo.
+
+Extensions should be created as directories under `keystone/contrib`. An
+extension that requires sql migrations should not change the common repository,
+but should instead have its own repository. This repository must be in the
+extension's directory in `keystone/contrib/<extension>/migrate_repo.` In
+addition it needs a subdirectory named `versions`. For example, if the
+extension name is `my_extension` then the directory structure would be
+`keystone/contrib/my_extension/migrate_repo/versions/`. For the migration
+o work, both the migrate_repo and versions subdirectories must have empty
+__init__.py files. SQLAlchemy-migrate will look for a configuration file in
+the migrate_repo named migrate.cfg. This conforms to a Key/value ini file
+format. A sample config file with the minimal set of values is::
+
+ [db_settings]
+ repository_id=my_extension
+ version_table=migrate_version
+ required_dbs=[]
+
+The directory `keystone/contrib/example` contains a sample extension migration.
+
+Migrations for extension must be explicitly run. To run a migration for a specific
+extension, run `keystone-manage --extension <name> db_sync`.
+
Initial Sample Data
-------------------