#!/www/python/bin/python
"""
$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/dulcinea/site/update_db.py $
$Id: update_db.py 29993 2007-08-13 17:00:28Z dbinger $

When we update the live site, this is our procedure.
Make a tarball of the running code and database file.
This is the emergency kit.
Copy the revised code into place.

If the code revisions require corresponding data revisions, 
  Copy the database file to a temporary name.
  Run an update_db.py script that changes attribute names, classes,
  or whatever is needed to convert the database to agree with the 
  new version of the code.  
  qp -d <site>
  Move the old database file away.  Move the fixed version into place.
  qp -u <site>
Otherwise,
  there are no data changes, so we just 
  qp -q <site>

This script is intended to serve as an example of an update_db.py
for a site named "dulcinea".
"""
from qp.lib.site import Site
import sys
connection = root = commit = pack = trace = None
# This call sets connection, root, commit, pack, and trace.
Site('dulcinea').update_db_environment(globals(), *sys.argv[1:])

# Do required changes here.


commit() 
# pack() # optional, but nice if you have time for it.  
