1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/308f95b0f2b0/ Changeset: 308f95b0f2b0 User: dannon Date: 2014-09-10 02:47:48 Summary: Revert accidental replacement of symlinks w/ real file from ce088c6. Thanks @jmchilton. Affected #: 17 files diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0001_add_tool_shed_repository_table.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0001_add_tool_shed_repository_table.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0001_add_tool_shed_repository_table.py @@ -1,51 +1,1 @@ -""" -Migration script to add the tool_shed_repository table. -""" -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * -import sys, logging -from galaxy.model.custom_types import * -from sqlalchemy.exc import * -import datetime -now = datetime.datetime.utcnow - -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -# New table to store information about cloned tool shed repositories. -ToolShedRepository_table = Table( "tool_shed_repository", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_shed", TrimmedString( 255 ), index=True ), - Column( "name", TrimmedString( 255 ), index=True ), - Column( "description" , TEXT ), - Column( "owner", TrimmedString( 255 ), index=True ), - Column( "changeset_revision", TrimmedString( 255 ), index=True ), - Column( "deleted", Boolean, index=True, default=False ) ) - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - try: - ToolShedRepository_table.create() - except Exception, e: - log.debug( "Creating tool_shed_repository table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - try: - ToolShedRepository_table.drop() - except Exception, e: - log.debug( "Dropping tool_shed_repository table failed: %s" % str( e ) ) +../../../migrate/versions/0082_add_tool_shed_repository_table.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0002_add_tool_shed_repository_table_columns.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0002_add_tool_shed_repository_table_columns.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0002_add_tool_shed_repository_table_columns.py @@ -1,79 +1,1 @@ -""" -Migration script to add the metadata, update_available and includes_datatypes columns to the tool_shed_repository table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def get_default_false(migrate_engine): - if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite': - return "0" - elif migrate_engine.name in ['postgresql', 'postgres']: - return "false" - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - c = Column( "metadata", JSONType(), nullable=True ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.metadata - except Exception, e: - print "Adding metadata column to the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Adding metadata column to the tool_shed_repository table failed: %s" % str( e ) ) - c = Column( "includes_datatypes", Boolean, index=True, default=False ) - try: - c.create( ToolShedRepository_table, index_name="ix_tool_shed_repository_includes_datatypes") - assert c is ToolShedRepository_table.c.includes_datatypes - migrate_engine.execute( "UPDATE tool_shed_repository SET includes_datatypes=%s" % get_default_false(migrate_engine)) - except Exception, e: - print "Adding includes_datatypes column to the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Adding includes_datatypes column to the tool_shed_repository table failed: %s" % str( e ) ) - c = Column( "update_available", Boolean, default=False ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.update_available - migrate_engine.execute( "UPDATE tool_shed_repository SET update_available=%s" % get_default_false(migrate_engine)) - except Exception, e: - print "Adding update_available column to the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Adding update_available column to the tool_shed_repository table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - try: - ToolShedRepository_table.c.metadata.drop() - except Exception, e: - print "Dropping column metadata from the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Dropping column metadata from the tool_shed_repository table failed: %s" % str( e ) ) - try: - ToolShedRepository_table.c.includes_datatypes.drop() - except Exception, e: - print "Dropping column includes_datatypes from the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Dropping column includes_datatypes from the tool_shed_repository table failed: %s" % str( e ) ) - try: - ToolShedRepository_table.c.update_available.drop() - except Exception, e: - print "Dropping column update_available from the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Dropping column update_available from the tool_shed_repository table failed: %s" % str( e ) ) +../../../migrate/versions/0086_add_tool_shed_repository_table_columns.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0003_tool_id_guid_map_table.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0003_tool_id_guid_map_table.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0003_tool_id_guid_map_table.py @@ -1,52 +1,1 @@ -""" -Migration script to create the tool_id_guid_map table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -ToolIdGuidMap_table = Table( "tool_id_guid_map", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_id", String( 255 ) ), - Column( "tool_version", TEXT ), - Column( "tool_shed", TrimmedString( 255 ) ), - Column( "repository_owner", TrimmedString( 255 ) ), - Column( "repository_name", TrimmedString( 255 ) ), - Column( "guid", TEXT, index=True, unique=True ) ) - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - try: - ToolIdGuidMap_table.create() - except Exception, e: - log.debug( "Creating tool_id_guid_map table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - try: - ToolIdGuidMap_table.drop() - except Exception, e: - log.debug( "Dropping tool_id_guid_map table failed: %s" % str( e ) ) +../../../migrate/versions/0087_tool_id_guid_map_table.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0004_add_installed_changeset_revison_column.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0004_add_installed_changeset_revison_column.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0004_add_installed_changeset_revison_column.py @@ -1,64 +1,1 @@ -""" -Migration script to add the installed_changeset_revision column to the tool_shed_repository table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - col = Column( "installed_changeset_revision", TrimmedString( 255 ) ) - try: - col.create( ToolShedRepository_table ) - assert col is ToolShedRepository_table.c.installed_changeset_revision - except Exception, e: - print "Adding installed_changeset_revision column to the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Adding installed_changeset_revision column to the tool_shed_repository table failed: %s" % str( e ) ) - # Update each row by setting the value of installed_changeset_revison to be the value of changeset_revision. - # This will be problematic if the value of changeset_revision was updated to something other than the value - # that it was when the repository was installed (because the install path determined in real time will attempt to - # find the repository using the updated changeset_revison instead of the required installed_changeset_revision), - # but at the time this script was written, this scenario is extremely unlikely. - cmd = "SELECT id AS id, " \ - + "installed_changeset_revision AS installed_changeset_revision, " \ - + "changeset_revision AS changeset_revision " \ - + "FROM tool_shed_repository;" - tool_shed_repositories = migrate_engine.execute( cmd ).fetchall() - update_count = 0 - for row in tool_shed_repositories: - cmd = "UPDATE tool_shed_repository " \ - + "SET installed_changeset_revision = '%s' " % row.changeset_revision \ - + "WHERE changeset_revision = '%s';" % row.changeset_revision - migrate_engine.execute( cmd ) - update_count += 1 - print "Updated the installed_changeset_revision column for ", update_count, " rows in the tool_shed_repository table. " -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - try: - ToolShedRepository_table.c.installed_changeset_revision.drop() - except Exception, e: - print "Dropping column installed_changeset_revision from the tool_shed_repository table failed: %s" % str( e ) - log.debug( "Dropping column installed_changeset_revision from the tool_shed_repository table failed: %s" % str( e ) ) +../../../migrate/versions/0088_add_installed_changeset_revison_column.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0005_add_tool_shed_repository_table_columns.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0005_add_tool_shed_repository_table_columns.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0005_add_tool_shed_repository_table_columns.py @@ -1,63 +1,1 @@ -""" -Migration script to add the uninstalled and dist_to_shed columns to the tool_shed_repository table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def default_false(migrate_engine): - if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite': - return "0" - elif migrate_engine.name in ['postgresql', 'postgres']: - return "false" - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - c = Column( "uninstalled", Boolean, default=False ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.uninstalled - migrate_engine.execute( "UPDATE tool_shed_repository SET uninstalled=%s" % default_false(migrate_engine) ) - except Exception, e: - print "Adding uninstalled column to the tool_shed_repository table failed: %s" % str( e ) - c = Column( "dist_to_shed", Boolean, default=False ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.dist_to_shed - migrate_engine.execute( "UPDATE tool_shed_repository SET dist_to_shed=%s" % default_false(migrate_engine) ) - except Exception, e: - print "Adding dist_to_shed column to the tool_shed_repository table failed: %s" % str( e ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - try: - ToolShedRepository_table.c.uninstalled.drop() - except Exception, e: - print "Dropping column uninstalled from the tool_shed_repository table failed: %s" % str( e ) - try: - ToolShedRepository_table.c.dist_to_shed.drop() - except Exception, e: - print "Dropping column dist_to_shed from the tool_shed_repository table failed: %s" % str( e ) +../../../migrate/versions/0090_add_tool_shed_repository_table_columns.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0006_add_tool_version_tables.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0006_add_tool_version_tables.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0006_add_tool_version_tables.py @@ -1,122 +1,1 @@ -""" -Migration script to create the tool_version and tool_version_association tables and drop the tool_id_guid_map table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * -from galaxy.model.custom_types import _sniffnfix_pg9_hex -from galaxy.util.json import loads, dumps - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() -#migrate_engine = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) ) - -def nextval( table, col='id' ): - if migrate_engine.name == 'postgres': - return "nextval('%s_%s_seq')" % ( table, col ) - elif migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite': - return "null" - else: - raise Exception( 'Unable to convert data for unknown database type: %s' % migrate_engine.name ) - -def localtimestamp(): - if migrate_engine.name == 'postgres' or migrate_engine.name == 'mysql': - return "LOCALTIMESTAMP" - elif migrate_engine.name == 'sqlite': - return "current_date || ' ' || current_time" - else: - raise Exception( 'Unable to convert data for unknown database type: %s' % db ) - -ToolVersion_table = Table( "tool_version", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_id", String( 255 ) ), - Column( "tool_shed_repository_id", Integer, ForeignKey( "tool_shed_repository.id" ), index=True, nullable=True ) ) - -ToolVersionAssociation_table = Table( "tool_version_association", metadata, - Column( "id", Integer, primary_key=True ), - Column( "tool_id", Integer, ForeignKey( "tool_version.id" ), index=True, nullable=False ), - Column( "parent_id", Integer, ForeignKey( "tool_version.id" ), index=True, nullable=False ) ) - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - - ToolIdGuidMap_table = Table( "tool_id_guid_map", metadata, autoload=True ) - - metadata.reflect() - # Create the tables. - try: - ToolVersion_table.create() - except Exception, e: - log.debug( "Creating tool_version table failed: %s" % str( e ) ) - try: - ToolVersionAssociation_table.create() - except Exception, e: - log.debug( "Creating tool_version_association table failed: %s" % str( e ) ) - # Populate the tool table with tools included in installed tool shed repositories. - cmd = "SELECT id, metadata FROM tool_shed_repository" - result = migrate_engine.execute( cmd ) - count = 0 - for row in result: - if row[1]: - tool_shed_repository_id = row[0] - repository_metadata = loads( _sniffnfix_pg9_hex( str( row[1] ) ) ) - # Create a new row in the tool table for each tool included in repository. We will NOT - # handle tool_version_associaions because we do not have the information we need to do so. - tools = repository_metadata.get( 'tools', [] ) - for tool_dict in tools: - cmd = "INSERT INTO tool_version VALUES (%s, %s, %s, '%s', %s)" % \ - ( nextval( 'tool_version' ), localtimestamp(), localtimestamp(), tool_dict[ 'guid' ], tool_shed_repository_id ) - migrate_engine.execute( cmd ) - count += 1 - print "Added %d rows to the new tool_version table." % count - # Drop the tool_id_guid_map table since the 2 new tables render it unnecessary. - try: - ToolIdGuidMap_table.drop() - except Exception, e: - log.debug( "Dropping tool_id_guid_map table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - - ToolIdGuidMap_table = Table( "tool_id_guid_map", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_id", String( 255 ) ), - Column( "tool_version", TEXT ), - Column( "tool_shed", TrimmedString( 255 ) ), - Column( "repository_owner", TrimmedString( 255 ) ), - Column( "repository_name", TrimmedString( 255 ) ), - Column( "guid", TEXT, index=True, unique=True ) ) - - metadata.reflect() - try: - ToolVersionAssociation_table.drop() - except Exception, e: - log.debug( "Dropping tool_version_association table failed: %s" % str( e ) ) - try: - ToolVersion_table.drop() - except Exception, e: - log.debug( "Dropping tool_version table failed: %s" % str( e ) ) - try: - ToolIdGuidMap_table.create() - except Exception, e: - log.debug( "Creating tool_id_guid_map table failed: %s" % str( e ) ) +../../../migrate/versions/0091_add_tool_version_tables.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0007_add_migrate_tools_table.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0007_add_migrate_tools_table.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0007_add_migrate_tools_table.py @@ -1,50 +1,1 @@ -""" -Migration script to create the migrate_tools table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -MigrateTools_table = Table( "migrate_tools", metadata, - Column( "repository_id", TrimmedString( 255 ) ), - Column( "repository_path", TEXT ), - Column( "version", Integer ) ) - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - - metadata.reflect() - # Create the table. - try: - MigrateTools_table.create() - cmd = "INSERT INTO migrate_tools VALUES ('GalaxyTools', 'lib/galaxy/tool_shed/migrate', %d)" % 1 - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Creating migrate_tools table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - try: - MigrateTools_table.drop() - except Exception, e: - log.debug( "Dropping migrate_tools table failed: %s" % str( e ) ) +../../../migrate/versions/0092_add_migrate_tools_table.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0008_add_ctx_rev_column.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0008_add_ctx_rev_column.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0008_add_ctx_rev_column.py @@ -1,44 +1,1 @@ -""" -Migration script to add the ctx_rev column to the tool_shed_repository table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - col = Column( "ctx_rev", TrimmedString( 10 ) ) - try: - col.create( ToolShedRepository_table ) - assert col is ToolShedRepository_table.c.ctx_rev - except Exception, e: - print "Adding ctx_rev column to the tool_shed_repository table failed: %s" % str( e ) -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - try: - ToolShedRepository_table.c.ctx_rev.drop() - except Exception, e: - print "Dropping column ctx_rev from the tool_shed_repository table failed: %s" % str( e ) +../../../migrate/versions/0097_add_ctx_rev_column.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0009_add_tool_dependency_table.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0009_add_tool_dependency_table.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0009_add_tool_dependency_table.py @@ -1,51 +1,1 @@ -""" -Migration script to add the tool_dependency table. -""" -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * -import sys, logging -from galaxy.model.custom_types import * -from sqlalchemy.exc import * -import datetime -now = datetime.datetime.utcnow - -log = logging.getLogger( __name__ ) -log.setLevel( logging.DEBUG ) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -# New table to store information about cloned tool shed repositories. -ToolDependency_table = Table( "tool_dependency", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_shed_repository_id", Integer, ForeignKey( "tool_shed_repository.id" ), index=True, nullable=False ), - Column( "installed_changeset_revision", TrimmedString( 255 ) ), - Column( "name", TrimmedString( 255 ) ), - Column( "version", TrimmedString( 40 ) ), - Column( "type", TrimmedString( 40 ) ), - Column( "uninstalled", Boolean, default=False ) ) - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - try: - ToolDependency_table.create() - except Exception, e: - log.debug( "Creating tool_dependency table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - try: - ToolDependency_table.drop() - except Exception, e: - log.debug( "Dropping tool_dependency table failed: %s" % str( e ) ) +../../../migrate/versions/0099_add_tool_dependency_table.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0010_alter_tool_dependency_table_version_column.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0010_alter_tool_dependency_table_version_column.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0010_alter_tool_dependency_table_version_column.py @@ -1,54 +1,1 @@ -""" -Migration script to alter the type of the tool_dependency.version column from TrimmedString(40) to Text. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolDependency_table = Table( "tool_dependency", metadata, autoload=True ) - # Change the tool_dependency table's version column from TrimmedString to Text. - if migrate_engine.name in ['postgresql', 'postgres']: - cmd = "ALTER TABLE tool_dependency ALTER COLUMN version TYPE Text;" - elif migrate_engine.name == 'mysql': - cmd = "ALTER TABLE tool_dependency MODIFY COLUMN version Text;" - else: - # We don't have to do anything for sqlite tables. From the sqlite documentation at http://sqlite.org/datatype3.html: - # 1.0 Storage Classes and Datatypes - # Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes: - # NULL. The value is a NULL value. - # INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value. - # REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number. - # TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE). - # BLOB. The value is a blob of data, stored exactly as it was input. - cmd = None - if cmd: - try: - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Altering tool_dependency.version column from TrimmedString(40) to Text failed: %s" % str( e ) ) -def downgrade(migrate_engine): - metadata.bind = migrate_engine - # Not necessary to change column type Text to TrimmedString(40). - pass +../../../migrate/versions/0100_alter_tool_dependency_table_version_column.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0011_drop_installed_changeset_revision_column.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0011_drop_installed_changeset_revision_column.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0011_drop_installed_changeset_revision_column.py @@ -1,41 +1,1 @@ -""" -Migration script to drop the installed_changeset_revision column from the tool_dependency table. -""" -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * -import sys, logging -from galaxy.model.custom_types import * -from sqlalchemy.exc import * -import datetime -now = datetime.datetime.utcnow - -log = logging.getLogger( __name__ ) -log.setLevel( logging.DEBUG ) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - try: - ToolDependency_table = Table( "tool_dependency", metadata, autoload=True ) - except NoSuchTableError: - ToolDependency_table = None - log.debug( "Failed loading table tool_dependency" ) - if ToolDependency_table is not None: - try: - col = ToolDependency_table.c.installed_changeset_revision - col.drop() - except Exception, e: - log.debug( "Dropping column 'installed_changeset_revision' from tool_dependency table failed: %s" % ( str( e ) ) ) -def downgrade(migrate_engine): - metadata.bind = migrate_engine - pass +../../../migrate/versions/0101_drop_installed_changeset_revision_column.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0012_add_tool_dependency_status_columns.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0012_add_tool_dependency_status_columns.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0012_add_tool_dependency_status_columns.py @@ -1,71 +1,1 @@ -""" -Migration script to add status and error_message columns to the tool_dependency table and drop the uninstalled column from the tool_dependency table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolDependency_table = Table( "tool_dependency", metadata, autoload=True ) - if migrate_engine.name == 'sqlite': - col = Column( "status", TrimmedString( 255 )) - else: - col = Column( "status", TrimmedString( 255 ), nullable=False) - try: - col.create( ToolDependency_table ) - assert col is ToolDependency_table.c.status - except Exception, e: - print "Adding status column to the tool_dependency table failed: %s" % str( e ) - col = Column( "error_message", TEXT ) - try: - col.create( ToolDependency_table ) - assert col is ToolDependency_table.c.error_message - except Exception, e: - print "Adding error_message column to the tool_dependency table failed: %s" % str( e ) - - if migrate_engine.name != 'sqlite': - #This breaks in sqlite due to failure to drop check constraint. - # TODO move to alembic. - try: - ToolDependency_table.c.uninstalled.drop() - except Exception, e: - print "Dropping uninstalled column from the tool_dependency table failed: %s" % str( e ) -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolDependency_table = Table( "tool_dependency", metadata, autoload=True ) - try: - ToolDependency_table.c.status.drop() - except Exception, e: - print "Dropping column status from the tool_dependency table failed: %s" % str( e ) - try: - ToolDependency_table.c.error_message.drop() - except Exception, e: - print "Dropping column error_message from the tool_dependency table failed: %s" % str( e ) - col = Column( "uninstalled", Boolean, default=False ) - try: - col.create( ToolDependency_table ) - assert col is ToolDependency_table.c.uninstalled - except Exception, e: - print "Adding uninstalled column to the tool_dependency table failed: %s" % str( e ) +../../../migrate/versions/0102_add_tool_dependency_status_columns.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0013_add_tool_shed_repository_status_columns.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0013_add_tool_shed_repository_status_columns.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0013_add_tool_shed_repository_status_columns.py @@ -1,69 +1,1 @@ -"""Migration script to add status and error_message columns to the tool_shed_repository table.""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -metadata = MetaData() - -def upgrade(migrate_engine): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - # Add the status column to the tool_shed_repository table. - col = Column( "status", TrimmedString( 255 ) ) - try: - col.create( ToolShedRepository_table ) - assert col is ToolShedRepository_table.c.status - except Exception, e: - print "Adding status column to the tool_shed_repository table failed: %s" % str( e ) - # Add the error_message column to the tool_shed_repository table. - col = Column( "error_message", TEXT ) - try: - col.create( ToolShedRepository_table ) - assert col is ToolShedRepository_table.c.error_message - except Exception, e: - print "Adding error_message column to the tool_shed_repository table failed: %s" % str( e ) - # Update the status column value for tool_shed_repositories to the default value 'Installed'. - cmd = "UPDATE tool_shed_repository SET status = 'Installed';" - try: - migrate_engine.execute( cmd ) - except Exception, e: - print "Exception executing sql command: " - print cmd - print str( e ) - # Update the status column for tool_shed_repositories that have been uninstalled. - cmd = "UPDATE tool_shed_repository SET status = 'Uninstalled' WHERE uninstalled;" - try: - migrate_engine.execute( cmd ) - except Exception, e: - print "Exception executing sql command: " - print cmd - print str( e ) - # Update the status column for tool_shed_repositories that have been deactivated. - cmd = "UPDATE tool_shed_repository SET status = 'Deactivated' where deleted and not uninstalled;" - try: - migrate_engine.execute( cmd ) - except Exception, e: - print "Exception executing sql command: " - print cmd - print str( e ) -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - try: - ToolShedRepository_table.c.status.drop() - except Exception, e: - print "Dropping column status from the tool_shed_repository table failed: %s" % str( e ) - try: - ToolShedRepository_table.c.error_message.drop() - except Exception, e: - print "Dropping column error_message from the tool_shed_repository table failed: %s" % str( e ) +../../../migrate/versions/0103_add_tool_shed_repository_status_columns.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0014_add_repository_dependency_tables.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0014_add_repository_dependency_tables.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0014_add_repository_dependency_tables.py @@ -1,60 +1,1 @@ -""" -Migration script to add the repository_dependency and repository_repository_dependency_association tables. -""" -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * -import sys, logging -from galaxy.model.custom_types import * -from sqlalchemy.exc import * -import datetime -now = datetime.datetime.utcnow - -log = logging.getLogger( __name__ ) -log.setLevel( logging.DEBUG ) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -RepositoryDependency_table = Table( "repository_dependency", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_shed_repository_id", Integer, ForeignKey( "tool_shed_repository.id" ), index=True, nullable=False ) ) - -RepositoryRepositoryDependencyAssociation_table = Table( "repository_repository_dependency_association", metadata, - Column( "id", Integer, primary_key=True ), - Column( "create_time", DateTime, default=now ), - Column( "update_time", DateTime, default=now, onupdate=now ), - Column( "tool_shed_repository_id", Integer, ForeignKey( "tool_shed_repository.id" ), index=True ), - Column( "repository_dependency_id", Integer, ForeignKey( "repository_dependency.id" ), index=True ) ) - -def upgrade(migrate_engine): - print __doc__ - metadata.bind = migrate_engine - metadata.reflect() - try: - RepositoryDependency_table.create() - except Exception, e: - log.debug( "Creating repository_dependency table failed: %s" % str( e ) ) - try: - RepositoryRepositoryDependencyAssociation_table.create() - except Exception, e: - log.debug( "Creating repository_repository_dependency_association table failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - metadata.bind = migrate_engine - metadata.reflect() - try: - RepositoryRepositoryDependencyAssociation_table.drop() - except Exception, e: - log.debug( "Dropping repository_repository_dependency_association table failed: %s" % str( e ) ) - try: - RepositoryDependency_table.drop() - except Exception, e: - log.debug( "Dropping repository_dependency table failed: %s" % str( e ) ) +../../../migrate/versions/0109_add_repository_dependency_tables.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0015_update_migrate_tools_table.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0015_update_migrate_tools_table.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0015_update_migrate_tools_table.py @@ -1,38 +1,1 @@ -""" -Migration script to update the migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -def upgrade(migrate_engine): - print __doc__ - # Create the table. - try: - cmd = "UPDATE migrate_tools set repository_path='lib/galaxy/tool_shed/migrate';" - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Updating migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - try: - cmd = "UPDATE migrate_tools set repository_path='lib/galaxy/tool_shed/migrate';" - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Updating migrate_tools.repository_path column to point to the old location lib/galaxy/tool_shed/migrate failed: %s" % str( e ) ) +../../../migrate/versions/0113_update_migrate_tools_table.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0016_update_migrate_tools_table_again.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0016_update_migrate_tools_table_again.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0016_update_migrate_tools_table_again.py @@ -1,40 +1,1 @@ -""" -Migration script to update the migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * - -import datetime -now = datetime.datetime.utcnow -# Need our custom types, but don't import anything else from model -from galaxy.model.custom_types import * - -import sys, logging -log = logging.getLogger( __name__ ) -log.setLevel(logging.DEBUG) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - - -def upgrade(migrate_engine): - print __doc__ - # Create the table. - try: - cmd = "UPDATE migrate_tools set repository_path='lib/tool_shed/galaxy_install/migrate';" - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Updating migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate failed: %s" % str( e ) ) - -def downgrade(migrate_engine): - try: - cmd = "UPDATE migrate_tools set repository_path='lib/galaxy/tool_shed/migrate';" - migrate_engine.execute( cmd ) - except Exception, e: - log.debug( "Updating migrate_tools.repository_path column to point to the old location lib/galaxy/tool_shed/migrate failed: %s" % str( e ) ) - +../../../migrate/versions/0114_update_migrate_tools_table_again.py \ No newline at end of file diff -r 89ab3ca6171d10d37d26fb7c50242bd6dcde45d9 -r 308f95b0f2b01930fab8f43598b48ba9d680e568 lib/galaxy/model/tool_shed_install/migrate/versions/0017_drop_update_available_col_add_tool_shed_status_col.py --- a/lib/galaxy/model/tool_shed_install/migrate/versions/0017_drop_update_available_col_add_tool_shed_status_col.py +++ b/lib/galaxy/model/tool_shed_install/migrate/versions/0017_drop_update_available_col_add_tool_shed_status_col.py @@ -1,77 +1,1 @@ -""" -Migration script to drop the update_available Boolean column and replace it with the tool_shed_status JSONType column in the tool_shed_repository table. -""" - -from sqlalchemy import * -from sqlalchemy.orm import * -from migrate import * -from migrate.changeset import * -import sys, logging -from galaxy.model.custom_types import * -from sqlalchemy.exc import * -import datetime -now = datetime.datetime.utcnow - -log = logging.getLogger( __name__ ) -log.setLevel( logging.DEBUG ) -handler = logging.StreamHandler( sys.stdout ) -format = "%(name)s %(levelname)s %(asctime)s %(message)s" -formatter = logging.Formatter( format ) -handler.setFormatter( formatter ) -log.addHandler( handler ) - -metadata = MetaData() - -def default_false( migrate_engine ): - if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite': - return "0" - elif migrate_engine.name in [ 'postgresql', 'postgres' ]: - return "false" - -def upgrade( migrate_engine ): - metadata.bind = migrate_engine - print __doc__ - metadata.reflect() - try: - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - except NoSuchTableError: - ToolShedRepository_table = None - log.debug( "Failed loading table tool_shed_repository" ) - if ToolShedRepository_table is not None: - # For some unknown reason it is no longer possible to drop a column in a migration script if using the sqlite database. - if migrate_engine.name != 'sqlite': - try: - col = ToolShedRepository_table.c.update_available - col.drop() - except Exception, e: - print "Dropping column update_available from the tool_shed_repository table failed: %s" % str( e ) - c = Column( "tool_shed_status", JSONType, nullable=True ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.tool_shed_status - except Exception, e: - print "Adding tool_shed_status column to the tool_shed_repository table failed: %s" % str( e ) - -def downgrade( migrate_engine ): - metadata.bind = migrate_engine - metadata.reflect() - try: - ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True ) - except NoSuchTableError: - ToolShedRepository_table = None - log.debug( "Failed loading table tool_shed_repository" ) - if ToolShedRepository_table is not None: - # For some unknown reason it is no longer possible to drop a column in a migration script if using the sqlite database. - if migrate_engine.name != 'sqlite': - try: - col = ToolShedRepository_table.c.tool_shed_status - col.drop() - except Exception, e: - print "Dropping column tool_shed_status from the tool_shed_repository table failed: %s" % str( e ) - c = Column( "update_available", Boolean, default=False ) - try: - c.create( ToolShedRepository_table ) - assert c is ToolShedRepository_table.c.update_available - migrate_engine.execute( "UPDATE tool_shed_repository SET update_available=%s" % default_false( migrate_engine ) ) - except Exception, e: - print "Adding column update_available to the tool_shed_repository table failed: %s" % str( e ) +../../../migrate/versions/0116_drop_update_available_col_add_tool_shed_status_col.py \ No newline at end of file Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.