fix rst syntax in database schema migrations docs

Change-Id: Idde4cf9b472663da63b1cf16bcec83a3100fab5e
This commit is contained in:
Dolph Mathews 2013-09-10 14:50:58 -05:00
parent d7eff43844
commit acde6909be
1 changed files with 21 additions and 18 deletions

View File

@ -73,32 +73,35 @@ place::
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.
Keystone uses 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::
.. _SQLAlchemy-migrate: http://code.google.com/p/sqlalchemy-migrate/
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 to
work, both the ``migrate_repo`` and ``versions`` subdirectories must have
``__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 configuration 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.
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`.
Migrations must be explicitly run for each extension individually. To run a
migration for a specific extension, run ``keystone-manage --extension <name>
db_sync``.
Initial Sample Data
-------------------