# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Greg Von Kuster <greg@bx.psu.edu> # Date 1279632434 14400 # Node ID 84671d8f46845b7a5bcfcc8028e68eaf241a5058 # Parent 28e629ad59490af90a28bc45073a7cfc10ed646c Fix for sqlalchemy-migrate scripts so they will function across webapps - galaxy is the default, so no command line changes necessary when migrating the db. --- a/manage_db.sh +++ b/manage_db.sh @@ -2,7 +2,7 @@ ####### # NOTE: To downgrade to a specific version, use something like: -# sh manage_db.sh downgrade --version=3 +# sh manage_db.sh downgrade --version=3 <community if using that webapp - galaxy is the default> ####### cd `dirname $0` --- a/scripts/manage_db.py +++ b/scripts/manage_db.py @@ -12,11 +12,20 @@ pkg_resources.require( "sqlalchemy-migra from migrate.versioning.shell import main from ConfigParser import SafeConfigParser - log = logging.getLogger( __name__ ) +if sys.argv[-1] in [ 'community' ]: + # Need to pop the last arg so the command line args will be correct + # for sqlalchemy-migrate + webapp = sys.argv.pop() + config_file = 'community_wsgi.ini' + repo = 'lib/galaxy/webapps/community/model/migrate' +else: + config_file = 'universe_wsgi.ini' + repo = 'lib/galaxy/model/migrate' + cp = SafeConfigParser() -cp.read( "universe_wsgi.ini" ) +cp.read( config_file ) if cp.has_option( "app:main", "database_connection" ): db_url = cp.get( "app:main", "database_connection" ) @@ -43,4 +52,4 @@ except KeyError: # Let this go, it could possibly work with db's we don't support log.error( "database_connection contains an unknown SQLAlchemy database dialect: %s" % dialect ) -main( repository='lib/galaxy/model/migrate', url=db_url ) +main( repository=repo, url=db_url )