Skip to content
summerisgone edited this page Sep 13, 2010 · 4 revisions

Install

Get the application
$ git clone ssh://verne.redsolution.ru/srv/git/django-dbschema.git django-dbschema

Add dbschema into INSTALLED_APPS:
INSTALLED_APPS = (
….
‘dbschema’,
)

Add variable REVSTORE_DIR in settings.py:
REVSTORE_DIR = join(dirname(abspath(file)), ‘revstore’)

What we have?

After running `manage.py schema init` or `manage.py schema add` folder with name ‘revstore’ will be created at the same level as settings.py
In that folder revision files `revision_*.py` and revision sequence `sequence.py` will be located.
To get help on internal commands run `manage.py schema`

Available commands:

apply [revno] Apply given schema revision to database add Create empty revision file from template and append it to schema. You will need only edit revision file revno Print current database schema revision number log Log local repository count Print how much revisions you have forcerevno Override revision number in database forceupgrade Execute upgrade function form revno revision forcedowngrade Execute dowgrade function form revno revision init <app1 [app2 …]> Create revision with SQL script to create tables for applications (as sqlall command). initall Create revision with script to create all tables for all applications (as syncdb command). P.S: check references: some references can be commented, some references can be used before definition. reset Reset schema configuration
Clone this wiki locally