My favorites | Sign in
Project Logo
                
People details
Project owners:
  gasolin
Project committers:
ajones1

tgmigrate is an turbogears command extension which provide sqlalchemy migrate support

Install

$ easy_install tgmigrate

Usage

After install, tgmigrate plug an 'migrate' command into tg-admin console utility.

The basic syntax is

$ tg-admin migrate [command]

tgmigrate takes care the dburi and repository name for you.

The reference procedure is:

  1. quickstart project as usual:
      $ tg-admin quickstart -i -s demo
2. setup sqlalchemy dburi in demo/dev.cfg

3. create initial database

      $ tg-admin sql create
4. create repository 'migration'
     $ tg-admin migrate create
note the default repository folder named 'migration' is created in your project folder.
5. move your database to version control
     $ tg-admin migrate version_control
or briefly:
     $ tg-admin migrate vc
6. Now you could watch the current version in both database and repository
show repository version:
$ tg-admin migrate v
(tg-admin migrate version)
show database version:
$ tg-admin migrate dbv
(tg-admin migrate db_version)

then follow the migration doc http://code.google.com/p/sqlalchemy-migrate/wiki/MigrateVersioning to do the further stuff.









Hosted by Google Code