mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Update to 'new' except style.
This commit is contained in:
@@ -632,7 +632,7 @@ class Configuration( object ):
|
||||
if path not in [ None, False ] and not os.path.isdir( path ):
|
||||
try:
|
||||
os.makedirs( path )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise ConfigurationError( "Unable to create missing directory: %s\n%s" % ( path, e ) )
|
||||
|
||||
def check( self ):
|
||||
@@ -642,7 +642,7 @@ class Configuration( object ):
|
||||
if path not in [ None, False ] and not os.path.isdir( path ):
|
||||
try:
|
||||
os.makedirs( path )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise ConfigurationError( "Unable to create missing directory: %s\n%s" % ( path, e ) )
|
||||
# Create the directories that it makes sense to create
|
||||
if self.object_store_config_file is None:
|
||||
|
||||
@@ -958,7 +958,7 @@ class MzSQlite( SQlite ):
|
||||
if table_name not in result:
|
||||
return False
|
||||
return True
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.warn( '%s, sniff Exception: %s', self, e )
|
||||
return False
|
||||
|
||||
@@ -993,7 +993,7 @@ class IdpDB( SQlite ):
|
||||
if table_name not in result:
|
||||
return False
|
||||
return True
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.warn( '%s, sniff Exception: %s', self, e )
|
||||
return False
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class SDF(GenericMolFile):
|
||||
sdf_lines_accumulated = []
|
||||
if sdf_lines_accumulated:
|
||||
_write_part_sdf_file(sdf_lines_accumulated)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error('Unable to split files: %s' % str(e))
|
||||
raise
|
||||
split = classmethod(split)
|
||||
@@ -236,7 +236,7 @@ class MOL2(GenericMolFile):
|
||||
mol2_lines_accumulated = []
|
||||
if mol2_lines_accumulated:
|
||||
_write_part_mol2_file(mol2_lines_accumulated)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error('Unable to split files: %s' % str(e))
|
||||
raise
|
||||
split = classmethod(split)
|
||||
@@ -316,7 +316,7 @@ class FPS(GenericMolFile):
|
||||
lines_accumulated = []
|
||||
if lines_accumulated:
|
||||
_write_part_fingerprint_file(header_lines + lines_accumulated)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error('Unable to split files: %s' % str(e))
|
||||
raise
|
||||
split = classmethod(split)
|
||||
@@ -727,7 +727,7 @@ class CML(GenericXml):
|
||||
cml_lines_accumulated = []
|
||||
if cml_lines_accumulated:
|
||||
_write_part_cml_file(cml_lines_accumulated)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error('Unable to split files: %s' % str(e))
|
||||
raise
|
||||
split = classmethod(split)
|
||||
|
||||
@@ -996,7 +996,7 @@ class JobWrapper( object ):
|
||||
try:
|
||||
shutil.move( dataset_path.false_path, dataset_path.real_path )
|
||||
log.debug( "fail(): Moved %s to %s" % ( dataset_path.false_path, dataset_path.real_path ) )
|
||||
except ( IOError, OSError ), e:
|
||||
except ( IOError, OSError ) as e:
|
||||
log.error( "fail(): Missing output file in working directory: %s" % e )
|
||||
for dataset_assoc in job.output_datasets + job.output_library_datasets:
|
||||
dataset = dataset_assoc.dataset
|
||||
@@ -1202,7 +1202,7 @@ class JobWrapper( object ):
|
||||
os.stat( dataset.dataset.file_name )
|
||||
os.chown( dataset.dataset.file_name, os.getuid(), -1 )
|
||||
trynum = self.app.config.retry_job_output_collection
|
||||
except ( OSError, ObjectNotFound ), e:
|
||||
except ( OSError, ObjectNotFound ) as e:
|
||||
trynum += 1
|
||||
log.warning( 'Error accessing %s, will retry: %s', dataset.dataset.file_name, e )
|
||||
time.sleep( 2 )
|
||||
@@ -1388,7 +1388,7 @@ class JobWrapper( object ):
|
||||
|
||||
# fix permissions
|
||||
for path in [ dp.real_path for dp in self.get_mutable_output_fnames() ]:
|
||||
util.umask_fix_perms( path, self.app.config.umask, 0666, self.app.config.gid )
|
||||
util.umask_fix_perms( path, self.app.config.umask, 0o666, self.app.config.gid )
|
||||
|
||||
# Finally set the job state. This should only happen *after* all
|
||||
# dataset creation, and will allow us to eliminate force_history_refresh.
|
||||
@@ -1442,7 +1442,7 @@ class JobWrapper( object ):
|
||||
create=True,
|
||||
preserve_symlinks=True
|
||||
)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Error in collect_associated_files: %s" % ( e ) )
|
||||
|
||||
def _collect_metrics( self, has_metrics ):
|
||||
@@ -1715,7 +1715,7 @@ class JobWrapper( object ):
|
||||
self._change_ownership( self.user_system_pwent[0], str( self.user_system_pwent[3] ) )
|
||||
except:
|
||||
log.exception( '(%s) Failed to change ownership of %s, making world-writable instead' % ( job.id, self.working_directory ) )
|
||||
os.chmod( self.working_directory, 0777 )
|
||||
os.chmod( self.working_directory, 0o777 )
|
||||
|
||||
def reclaim_ownership( self ):
|
||||
job = self.get_job()
|
||||
|
||||
@@ -80,7 +80,7 @@ class EmailAction(DefaultJobAction):
|
||||
body = "Your Galaxy job generating dataset '%s' is complete as of %s." % (outdata, datetime.datetime.now().strftime( "%I:%M" ))
|
||||
try:
|
||||
send_mail( frm, to, subject, body, app.config )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error("EmailAction PJA Failed, exception: %s" % e)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -105,14 +105,14 @@ class DeferredJobQueue( object ):
|
||||
if job.is_check_time:
|
||||
try:
|
||||
job_state = self.plugins[job.plugin].check_job( job )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.__fail_job( job )
|
||||
log.exception( 'Set deferred job %s to error because of an exception in check_job(): %s' % ( job.id, str( e ) ) )
|
||||
continue
|
||||
if job_state == self.job_states.READY:
|
||||
try:
|
||||
self.plugins[job.plugin].run_job( job )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
self.__fail_job( job )
|
||||
log.exception( 'Set deferred job %s to error because of an exception in run_job(): %s' % ( job.id, str( e ) ) )
|
||||
continue
|
||||
|
||||
@@ -105,7 +105,7 @@ class DataTransfer( object ):
|
||||
tj = self.sa_session.query( self.app.model.TransferJob ).get( int( job.params['transfer_job_id'] ) )
|
||||
result_dict = tj.params
|
||||
result_dict['local_path'] = tj.path
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Updated transfer result unavailable, using old result. Error was: %s" % str( e ) )
|
||||
result_dict = job.params[ 'result' ]
|
||||
library_dataset_name = result_dict[ 'name' ]
|
||||
@@ -151,7 +151,7 @@ class DataTransfer( object ):
|
||||
# TODO: not sure if this flush is necessary
|
||||
self.sa_session.add( ldda )
|
||||
self.sa_session.flush()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.exception( 'Failure preparing library dataset for finished transfer job (id: %s) via deferred job (id: %s):' %
|
||||
( str( job.transfer_job.id ), str( job.id ) ) )
|
||||
ldda.state = ldda.states.ERROR
|
||||
|
||||
@@ -364,7 +364,7 @@ class JobHandlerQueue( object ):
|
||||
except JobNotReadyException as e:
|
||||
job_state = e.job_state or JOB_WAIT
|
||||
return job_state, None
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
failure_message = getattr( e, 'failure_message', DEFAULT_JOB_PUT_FAILURE_MESSAGE )
|
||||
if failure_message == DEFAULT_JOB_PUT_FAILURE_MESSAGE:
|
||||
log.exception( 'Failed to generate job destination' )
|
||||
@@ -384,7 +384,7 @@ class JobHandlerQueue( object ):
|
||||
usage = self.app.quota_agent.get_usage( user=job.user, history=job.history )
|
||||
if usage > quota:
|
||||
return JOB_USER_OVER_QUOTA, job_destination
|
||||
except AssertionError, e:
|
||||
except AssertionError as e:
|
||||
pass # No history, should not happen with an anon user
|
||||
return state, job_destination
|
||||
|
||||
@@ -743,7 +743,7 @@ class DefaultJobDispatcher( object ):
|
||||
runner_name = url.split(':', 1)[0]
|
||||
try:
|
||||
return self.job_runners[runner_name].url_to_destination(url)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.exception("Unable to convert legacy job runner URL '%s' to job destination, destination will be the '%s' runner with no params: %s" % (url, runner_name, e))
|
||||
return JobDestination(runner=runner_name)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class JobRunnerMapper( object ):
|
||||
for comp in rule_module_name.split( "." )[1:]:
|
||||
module = getattr( module, comp )
|
||||
modules.append( module )
|
||||
except BaseException, exception:
|
||||
except BaseException as exception:
|
||||
exception_str = str( exception )
|
||||
message = "%s rule module could not be loaded: %s" % ( rule_module_name, exception_str )
|
||||
log.debug( message )
|
||||
|
||||
@@ -178,7 +178,7 @@ def do_merge( job_wrapper, task_wrappers):
|
||||
log_error = "The output '%s' does not define a method for implementing parallelism" % output
|
||||
log.exception(log_error)
|
||||
raise Exception(log_error)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
stdout = 'Error merging files'
|
||||
log.exception( stdout )
|
||||
stderr = str(e)
|
||||
|
||||
@@ -102,7 +102,7 @@ class TransferManager( object ):
|
||||
# Request was valid
|
||||
response['result']['transfer_job_id'] = tj.id
|
||||
rval.append( response['result'] )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# State checking via the transfer daemon failed, just
|
||||
# return the state from the database instead. Callers can
|
||||
# look for the 'error' member of the response to see why
|
||||
|
||||
@@ -990,7 +990,7 @@ class ModelFilterParser( HasAModelManager ):
|
||||
return orm_filter
|
||||
|
||||
# by convention, assume most val parsers raise ValueError
|
||||
except ValueError, val_err:
|
||||
except ValueError as val_err:
|
||||
raise exceptions.RequestParameterInvalidException( 'unparsable value for filter',
|
||||
column=attr, operation=op, value=val, ValueError=str( val_err ) )
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class FolderManager( object ):
|
||||
raise InconsistentDatabase( 'Multiple folders found with the same id.' )
|
||||
except NoResultFound:
|
||||
raise RequestParameterInvalidException( 'No folder found with the id provided.' )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise InternalServerError( 'Error loading from the database.' + str( e ) )
|
||||
folder = self.secure( trans, folder, check_manageable, check_accessible )
|
||||
return folder
|
||||
|
||||
@@ -41,7 +41,7 @@ class LibraryManager( object ):
|
||||
raise exceptions.InconsistentDatabase( 'Multiple libraries found with the same id.' )
|
||||
except NoResultFound:
|
||||
raise exceptions.RequestParameterInvalidException( 'No library found with the id provided.' )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise exceptions.InternalServerError( 'Error loading from the database.' + str( e ) )
|
||||
library = self.secure( trans, library, check_accessible)
|
||||
return library
|
||||
|
||||
@@ -44,6 +44,6 @@ class RoleManager( base.ModelManager ):
|
||||
raise galaxy.exceptions.InconsistentDatabase( 'Multiple roles found with the same id.' )
|
||||
except sqlalchemy_exceptions.NoResultFound:
|
||||
raise galaxy.exceptions.RequestParameterInvalidException( 'No role found with the id provided.' )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
raise galaxy.exceptions.InternalServerError( 'Error loading from the database.' + str(e) )
|
||||
return role
|
||||
|
||||
@@ -52,7 +52,7 @@ class UserManager( base.ModelManager, deletable.PurgableManagerMixin ):
|
||||
try:
|
||||
self.session().flush()
|
||||
# TODO:?? flush needed for permissions below? If not, make optional
|
||||
except sqlalchemy.exc.IntegrityError, db_err:
|
||||
except sqlalchemy.exc.IntegrityError as db_err:
|
||||
raise exceptions.Conflict( db_err.message )
|
||||
|
||||
# can throw an sqlalx.IntegrityError if username not unique
|
||||
|
||||
@@ -2160,14 +2160,14 @@ class DatasetInstance( object ):
|
||||
if cp_from_ldda:
|
||||
lst.append( (cp_from_ldda, "(Data Library)") )
|
||||
return _source_dataset_chain( cp_from_ldda, lst )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.warning( e )
|
||||
try:
|
||||
cp_from_hda = dataset.copied_from_history_dataset_association
|
||||
if cp_from_hda:
|
||||
lst.append( (cp_from_hda, cp_from_hda.history.name) )
|
||||
return _source_dataset_chain( cp_from_hda, lst )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.warning( e )
|
||||
return lst
|
||||
return _source_dataset_chain( self, [] )
|
||||
@@ -2237,7 +2237,7 @@ class DatasetInstance( object ):
|
||||
converted_dataset = self.get_converted_dataset( trans, target_type )
|
||||
except NoConverterException:
|
||||
return self.conversion_messages.NO_CONVERTER
|
||||
except ConverterDependencyException, dep_error:
|
||||
except ConverterDependencyException as dep_error:
|
||||
return { 'kind': self.conversion_messages.ERROR, 'message': dep_error.value }
|
||||
|
||||
# Check dataset state and return any messages.
|
||||
@@ -3066,7 +3066,7 @@ class ImplicitlyConvertedDatasetAssociation( object ):
|
||||
self.purged = True
|
||||
try:
|
||||
os.unlink( self.file_name )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Failed to purge associated file (%s) from disk: %s" % ( self.file_name, e ) )
|
||||
|
||||
|
||||
@@ -4109,7 +4109,7 @@ class MetadataFile( StorableObject ):
|
||||
# Create directory if it does not exist
|
||||
try:
|
||||
os.makedirs( path )
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
# File Exists is okay, otherwise reraise
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
@@ -4408,7 +4408,7 @@ All samples in state: %(sample_state)s
|
||||
try:
|
||||
send_mail( frm, to, subject, body, trans.app.config )
|
||||
comments = "Email notification sent to %s." % ", ".join( to ).strip().strip( ',' )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
comments = "Email notification failed. (%s)" % str(e)
|
||||
# update the request history with the email notification event
|
||||
elif not trans.app.config.smtp_server:
|
||||
|
||||
@@ -344,13 +344,13 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'deleted', Boolean, index=True, default=False )
|
||||
col.create( User_table, index_name='ix_user_deleted')
|
||||
assert col is User_table.c.deleted
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'deleted' to galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
col = Column( 'purged', Boolean, index=True, default=False )
|
||||
col.create( User_table, index_name='ix_user_purged')
|
||||
assert col is User_table.c.purged
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'purged' to galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
# Add 1 new column to the history_dataset_association table
|
||||
try:
|
||||
@@ -363,7 +363,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'copied_from_library_dataset_dataset_association_id', Integer, nullable=True )
|
||||
col.create( HistoryDatasetAssociation_table)
|
||||
assert col is HistoryDatasetAssociation_table.c.copied_from_library_dataset_dataset_association_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'copied_from_library_dataset_dataset_association_id' to history_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
# Add 1 new column to the metadata_file table
|
||||
try:
|
||||
@@ -376,7 +376,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'lda_id', Integer, index=True, nullable=True )
|
||||
col.create( MetadataFile_table, index_name='ix_metadata_file_lda_id')
|
||||
assert col is MetadataFile_table.c.lda_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'lda_id' to metadata_file table failed: %s" % ( str( e ) ) )
|
||||
# Add 1 new column to the stored_workflow table - changeset 2328
|
||||
try:
|
||||
@@ -392,7 +392,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'importable', Boolean, default=False )
|
||||
col.create( StoredWorkflow_table )
|
||||
assert col is StoredWorkflow_table.c.importable
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'importable' to stored_workflow table failed: %s" % ( str( e ) ) )
|
||||
# Create an index on the Job.state column - changeset 2192
|
||||
try:
|
||||
@@ -404,7 +404,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i = Index( 'ix_job_state', Job_table.c.state )
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index to job.state column failed: %s" % ( str( e ) ) )
|
||||
# Add all of the new tables above
|
||||
metadata.create_all()
|
||||
@@ -426,7 +426,7 @@ def upgrade(migrate_engine):
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'history_dataset_association_copied_from_library_dataset_da_fkey' to table 'history_dataset_association' failed: %s" % ( str( e ) ) )
|
||||
# Add 1 foreign key constraint to the metadata_file table
|
||||
try:
|
||||
@@ -448,7 +448,7 @@ def upgrade(migrate_engine):
|
||||
name='metadata_file_lda_id_fkey' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'metadata_file_lda_id_fkey' to table 'metadata_file' failed: %s" % ( str( e ) ) )
|
||||
# Make sure we have at least 1 user
|
||||
cmd = "SELECT * FROM galaxy_user;"
|
||||
@@ -556,7 +556,7 @@ def downgrade(migrate_engine):
|
||||
name='metadata_file_lda_id_fkey' )
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping foreign key constraint 'metadata_file_lda_id_fkey' from table 'metadata_file' failed: %s" % ( str( e ) ) )
|
||||
# Drop 1 foreign key constraint from the history_dataset_association table
|
||||
try:
|
||||
@@ -576,132 +576,132 @@ def downgrade(migrate_engine):
|
||||
name='history_dataset_association_copied_from_library_dataset_da_fkey' )
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping foreign key constraint 'history_dataset_association_copied_from_library_dataset_da_fkey' from table 'history_dataset_association' failed: %s" % ( str( e ) ) )
|
||||
# Drop all of the new tables above
|
||||
try:
|
||||
UserGroupAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping user_group_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
UserRoleAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping user_role_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
GroupRoleAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping group_role_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
Group_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping galaxy_group table failed: %s" % str( e ) )
|
||||
try:
|
||||
DatasetPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping dataset_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryFolderPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetDatasetAssociationPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_association_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfoPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfoTemplatePermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
DefaultUserPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping default_user_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
DefaultHistoryPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping default_history_permissions table failed: %s" % str( e ) )
|
||||
try:
|
||||
Role_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping role table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetDatasetInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDataset_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetDatasetAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetDatasetInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_info_template_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
JobExternalOutputMetadata_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping job_external_output_metadata table failed: %s" % str( e ) )
|
||||
try:
|
||||
Library_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryFolder_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfoTemplateElement_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template_element table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_info_template_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryFolderInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder_info_template_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_info_template_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryFolderInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfoElement_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_element table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfo_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryItemInfoTemplate_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template table failed: %s" % str( e ) )
|
||||
# Drop the index on the Job.state column - changeset 2192
|
||||
try:
|
||||
@@ -713,7 +713,7 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
i = Index( 'ix_job_state', Job_table.c.state )
|
||||
i.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping index from job.state column failed: %s" % ( str( e ) ) )
|
||||
# Drop 1 column from the stored_workflow table - changeset 2328
|
||||
try:
|
||||
@@ -725,7 +725,7 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = StoredWorkflow_table.c.importable
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'importable' from stored_workflow table failed: %s" % ( str( e ) ) )
|
||||
# Drop 1 column from the metadata_file table
|
||||
try:
|
||||
@@ -737,7 +737,7 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = MetadataFile_table.c.lda_id
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'lda_id' from metadata_file table failed: %s" % ( str( e ) ) )
|
||||
# Drop 1 column from the history_dataset_association table
|
||||
try:
|
||||
@@ -749,7 +749,7 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = HistoryDatasetAssociation_table.c.copied_from_library_dataset_dataset_association_id
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'copied_from_library_dataset_dataset_association_id' from history_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
# Drop 2 columns from the galaxy_user table
|
||||
try:
|
||||
@@ -761,10 +761,10 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = User_table.c.deleted
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'deleted' from galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
col = User_table.c.purged
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'purged' from galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -32,31 +32,31 @@ def upgrade(migrate_engine):
|
||||
i = Index( 'ix_galaxy_user_deleted', User_table.c.deleted )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_galaxy_user_deleted' to galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
i = Index( 'ix_galaxy_user_purged', User_table.c.purged )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_galaxy_user_purged' to galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
# Set the default data in the galaxy_user table, but only for null values
|
||||
cmd = "UPDATE galaxy_user SET deleted = %s WHERE deleted is null"
|
||||
cmd = cmd % boolean_false()
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Setting default data for galaxy_user.deleted column failed: %s" % ( str( e ) ) )
|
||||
cmd = "UPDATE galaxy_user SET purged = %s WHERE purged is null"
|
||||
cmd = cmd % boolean_false()
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Setting default data for galaxy_user.purged column failed: %s" % ( str( e ) ) )
|
||||
# Add 1 index to the history_dataset_association table
|
||||
i = Index( 'ix_hda_copied_from_library_dataset_dataset_association_id', HistoryDatasetAssociation_table.c.copied_from_library_dataset_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_hda_copied_from_library_dataset_dataset_association_id' to history_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class Dataset( object ):
|
||||
# Create directory if it does not exist
|
||||
try:
|
||||
os.makedirs( dir )
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
# File Exists is okay, otherwise reraise
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
@@ -132,7 +132,7 @@ class Dataset( object ):
|
||||
"""Remove the file that corresponds to this data"""
|
||||
try:
|
||||
os.remove(self.data.file_name)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
log.critical('%s delete error %s' % (self.__class__.__name__, e))
|
||||
|
||||
|
||||
|
||||
@@ -37,24 +37,24 @@ def upgrade(migrate_engine):
|
||||
i = Index( 'ix_hda_extension', HistoryDatasetAssociation_table.c.extension )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_hda_extension' to history_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
|
||||
# Set the default data in the galaxy_user table, but only for null values
|
||||
cmd = "UPDATE history_dataset_association SET extension = 'qual454' WHERE extension = 'qual' and peek like \'>%%\'"
|
||||
try:
|
||||
db_session.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Resetting extension qual to qual454 in history_dataset_association failed: %s" % ( str( e ) ) )
|
||||
cmd = "UPDATE history_dataset_association SET extension = 'qualsolexa' WHERE extension = 'qual' and peek not like \'>%%\'"
|
||||
try:
|
||||
db_session.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Resetting extension qual to qualsolexa in history_dataset_association failed: %s" % ( str( e ) ) )
|
||||
# Add 1 index to the history_dataset_association table
|
||||
try:
|
||||
i.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping index 'ix_hda_extension' to history_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def upgrade(migrate_engine):
|
||||
# Create the history_user_share_association table
|
||||
try:
|
||||
HistoryUserShareAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating history_user_share_association table failed: %s" % str( e ) )
|
||||
# Add 1 column to the history table
|
||||
try:
|
||||
@@ -54,7 +54,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'importable', Boolean, index=True, default=False )
|
||||
col.create( History_table, index_name='ix_history_importable')
|
||||
assert col is History_table.c.importable
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'importable' to history table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = History_table.c.importable
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'importable' from history table failed: %s" % ( str( e ) ) )
|
||||
# Drop the history_user_share_association table
|
||||
try:
|
||||
HistoryUserShareAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping history_user_share_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -123,11 +123,11 @@ def upgrade(migrate_engine):
|
||||
# metadata.create_all()
|
||||
try:
|
||||
FormDefinitionCurrent_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating form_definition_current table failed: %s" % str( e ) )
|
||||
try:
|
||||
FormDefinition_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating form_definition table failed: %s" % str( e ) )
|
||||
# Add 1 foreign key constraint to the form_definition_current table
|
||||
if FormDefinitionCurrent_table is not None and FormDefinition_table is not None:
|
||||
@@ -137,31 +137,31 @@ def upgrade(migrate_engine):
|
||||
name='form_definition_current_latest_form_id_fk' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'form_definition_current_latest_form_id_fk' to table 'form_definition_current' failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
FormValues_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating form_values table failed: %s" % str( e ) )
|
||||
try:
|
||||
RequestType_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_type table failed: %s" % str( e ) )
|
||||
try:
|
||||
Request_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request table failed: %s" % str( e ) )
|
||||
try:
|
||||
Sample_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating sample table failed: %s" % str( e ) )
|
||||
try:
|
||||
SampleState_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating sample_state table failed: %s" % str( e ) )
|
||||
try:
|
||||
SampleEvent_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating sample_event table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -171,33 +171,33 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
FormDefinition_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping form_definition table failed: %s" % str( e ) )
|
||||
try:
|
||||
FormDefinitionCurrent_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping form_definition_current table failed: %s" % str( e ) )
|
||||
try:
|
||||
FormValues_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping form_values table failed: %s" % str( e ) )
|
||||
try:
|
||||
Request_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping request table failed: %s" % str( e ) )
|
||||
try:
|
||||
RequestType_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping request_type table failed: %s" % str( e ) )
|
||||
try:
|
||||
Sample_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping sample table failed: %s" % str( e ) )
|
||||
try:
|
||||
SampleState_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping sample_state table failed: %s" % str( e ) )
|
||||
try:
|
||||
SampleEvent_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping sample_event table failed: %s" % str( e ) )
|
||||
|
||||
@@ -42,7 +42,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( 'submitted', Boolean, default=False )
|
||||
col.create( Request_table)
|
||||
assert col is Request_table.c.submitted
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'submitted' to request table failed: %s" % ( str( e ) ) )
|
||||
|
||||
# Add 1 column to the sample table
|
||||
@@ -51,7 +51,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "bar_code", TrimmedString( 255 ), index=True )
|
||||
col.create( Sample_table, index_name='ix_sample_bar_code')
|
||||
assert col is Sample_table.c.bar_code
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'bar_code' to sample table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
HistoryDatasetAssociationDisplayAtAuthorization_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating history_dataset_association_display_at_authorization table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -65,5 +65,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
HistoryDatasetAssociationDisplayAtAuthorization_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping history_dataset_association_display_at_authorization table failed: %s" % str( e ) )
|
||||
|
||||
@@ -48,7 +48,7 @@ def upgrade(migrate_engine):
|
||||
i = Index( "ix_hdadaa_history_dataset_association_id", HistoryDatasetAssociationDisplayAtAuthorization_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_hdadaa_history_dataset_association_id' to table 'history_dataset_association_display_at_authorization' table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -60,5 +60,5 @@ def downgrade(migrate_engine):
|
||||
i = Index( "ix_hdadaa_history_dataset_association_id", HistoryDatasetAssociationDisplayAtAuthorization_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Removing index 'ix_hdadaa_history_dataset_association_id' from table 'history_dataset_association_display_at_authorization' table failed: %s" % str( e ) )
|
||||
|
||||
@@ -59,7 +59,7 @@ def upgrade(migrate_engine):
|
||||
# Add all of the new tables above
|
||||
try:
|
||||
UserAddress_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating user_address table failed: %s" % str( e ) )
|
||||
# Add 1 column to the request_type table
|
||||
try:
|
||||
@@ -72,7 +72,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "deleted", Boolean, index=True, default=False )
|
||||
col.create( RequestType_table, index_name='ix_request_type_deleted')
|
||||
assert col is RequestType_table.c.deleted
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'deleted' to request_type table failed: %s" % ( str( e ) ) )
|
||||
|
||||
# Delete the submitted column
|
||||
|
||||
@@ -82,7 +82,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info_permissions" )
|
||||
try:
|
||||
LibraryItemInfoPermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_permissions table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -92,7 +92,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info_template_permissions" )
|
||||
try:
|
||||
LibraryItemInfoTemplatePermissions_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template_permissions table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -102,7 +102,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info_element" )
|
||||
try:
|
||||
LibraryItemInfoElement_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_element table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -112,7 +112,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info_template_element" )
|
||||
try:
|
||||
LibraryItemInfoTemplateElement_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template_element table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -122,7 +122,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_info_template_association" )
|
||||
try:
|
||||
LibraryInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_info_template_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -132,7 +132,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_folder_info_template_association" )
|
||||
try:
|
||||
LibraryFolderInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder_info_template_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -142,7 +142,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_dataset_info_template_association" )
|
||||
try:
|
||||
LibraryDatasetInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_info_template_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -152,7 +152,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_dataset_dataset_info_template_association" )
|
||||
try:
|
||||
LibraryDatasetDatasetInfoTemplateAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_info_template_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -162,7 +162,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_info_association" )
|
||||
try:
|
||||
LibraryInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_info_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -172,7 +172,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_folder_info_association" )
|
||||
try:
|
||||
LibraryFolderInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_folder_info_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -182,7 +182,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_dataset_info_association" )
|
||||
try:
|
||||
LibraryDatasetInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_info_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -192,7 +192,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_dataset_dataset_info_association" )
|
||||
try:
|
||||
LibraryDatasetDatasetInfoAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_dataset_dataset_info_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -202,7 +202,7 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info" )
|
||||
try:
|
||||
LibraryItemInfo_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
@@ -212,21 +212,21 @@ def upgrade(migrate_engine):
|
||||
log.debug( "Failed loading table library_item_info_template" )
|
||||
try:
|
||||
LibraryItemInfoTemplate_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping library_item_info_template table failed: %s" % str( e ) )
|
||||
|
||||
# Create all new tables above
|
||||
try:
|
||||
LibraryInfoAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating library_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryFolderInfoAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating library_folder_info_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
LibraryDatasetDatasetInfoAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating library_dataset_dataset_info_association table failed: %s" % str( e ) )
|
||||
# Fix index on LibraryDatasetDatasetInfoAssociation_table for mysql
|
||||
if migrate_engine.name == 'mysql':
|
||||
@@ -235,7 +235,7 @@ def upgrade(migrate_engine):
|
||||
i = Index( "ix_lddaia_ldda_id", LibraryDatasetDatasetInfoAssociation_table.c.library_dataset_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_lddaia_ldda_id' to table 'library_dataset_dataset_info_association' table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ def upgrade(migrate_engine):
|
||||
# Create slug index manually afterward.
|
||||
i = Index( "ix_page_slug", Page_table.c.slug, mysql_length=200)
|
||||
i.create()
|
||||
except Exception, ex:
|
||||
except Exception as ex:
|
||||
log.debug(ex)
|
||||
log.debug( "Could not create page table" )
|
||||
try:
|
||||
|
||||
@@ -72,22 +72,22 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
Tag_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating tag table failed: %s" % str( e ) )
|
||||
try:
|
||||
HistoryTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_tag_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
DatasetTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating dataset_tag_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
HistoryDatasetAssociationTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -97,21 +97,21 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
Tag_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping tag table failed: %s" % str( e ) )
|
||||
try:
|
||||
HistoryTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_tag_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
DatasetTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping dataset_tag_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
HistoryDatasetAssociationTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -37,7 +37,7 @@ def upgrade(migrate_engine):
|
||||
i = Index( "ix_hda_ta_history_dataset_association_id", HistoryDatasetAssociationTagAssociation_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding index 'ix_hdata_history_dataset_association_id' to table 'history_dataset_association_tag_association' table failed: %s" % str( e ) )
|
||||
|
||||
@@ -48,6 +48,6 @@ def downgrade(migrate_engine):
|
||||
i = Index( "ix_hda_ta_history_dataset_association_id", HistoryDatasetAssociationTagAssociation_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Removing index 'ix_hdata_history_dataset_association_id' to table 'history_dataset_association_tag_association' table failed: %s" % str( e ) )
|
||||
|
||||
@@ -36,19 +36,19 @@ def upgrade(migrate_engine):
|
||||
i = Index( 'ix_library_folder_name', LibraryFolder_table.c.name, mysql_length=200 )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_library_folder_name' to library_folder table failed: %s" % ( str( e ) ) )
|
||||
# Add 1 index to the library_dataset_dataset_association table
|
||||
i = Index( 'ix_library_dataset_dataset_association_name', LibraryDatasetDatasetAssociation_table.c.name )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_library_dataset_dataset_association_name' to library_dataset_dataset_association table failed: %s" % ( str( e ) ) )
|
||||
# Add 1 index to the library_dataset table
|
||||
i = Index( 'ix_library_dataset_name', LibraryDataset_table.c.name )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index 'ix_library_dataset_name' to library_dataset table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -65,14 +65,14 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
HistoryTagAssociation_table.drop()
|
||||
HistoryTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Recreating history_tag_association table failed: %s" % str( e )
|
||||
log.debug( "Recreating history_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
DatasetTagAssociation_table.drop()
|
||||
DatasetTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Recreating dataset_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -87,17 +87,17 @@ def upgrade(migrate_engine):
|
||||
i = Index( "ix_hda_ta_history_dataset_association_id", HistoryDatasetAssociationTagAssociation_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding index 'ix_hda_ta_history_dataset_association_id' to table 'history_dataset_association_tag_association' table failed: %s" % str( e ) )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Recreating history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create page_tag_association table.
|
||||
try:
|
||||
PageTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating page_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -111,6 +111,6 @@ def downgrade(migrate_engine):
|
||||
# Drop page_tag_association table.
|
||||
try:
|
||||
PageTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping page_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -44,7 +44,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "folder_id", Integer, index=True )
|
||||
col.create( Request_table, index_name='ix_request_folder_id')
|
||||
assert col is Request_table.c.folder_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'folder_id' to request table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
LibraryFolder_table = Table( "library_folder", metadata, autoload=True )
|
||||
@@ -59,7 +59,7 @@ def upgrade(migrate_engine):
|
||||
name='request_folder_id_fk' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'request_folder_id_fk' to table 'library_folder' failed: %s" % ( str( e ) ) )
|
||||
# Create the type column in form_definition
|
||||
try:
|
||||
@@ -72,13 +72,13 @@ def upgrade(migrate_engine):
|
||||
col = Column( "type", TrimmedString( 255 ), index=True )
|
||||
col.create( FormDefinition_table, index_name='ix_form_definition_type')
|
||||
assert col is FormDefinition_table.c.type
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'type' to form_definition table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
col = Column( "layout", JSONType())
|
||||
col.create( FormDefinition_table )
|
||||
assert col is FormDefinition_table.c.layout
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'layout' to form_definition table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def upgrade(migrate_engine):
|
||||
# Create the job_to_output_library_dataset table
|
||||
try:
|
||||
JobToOutputLibraryDatasetAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Creating job_to_output_library_dataset table failed: %s" % str( e )
|
||||
log.debug( "Creating job_to_output_library_dataset table failed: %s" % str( e ) )
|
||||
# Create the library_folder_id column
|
||||
@@ -57,7 +57,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "library_folder_id", Integer, index=True )
|
||||
col.create( Job_table, index_name='ix_job_library_folder_id')
|
||||
assert col is Job_table.c.library_folder_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'library_folder_id' to job table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
LibraryFolder_table = Table( "library_folder", metadata, autoload=True )
|
||||
@@ -74,7 +74,7 @@ def upgrade(migrate_engine):
|
||||
name='job_library_folder_id_fk' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'job_library_folder_id_fk' to table 'library_folder' failed: %s" % ( str( e ) ) )
|
||||
# Create the ix_dataset_state index
|
||||
try:
|
||||
@@ -85,7 +85,7 @@ def upgrade(migrate_engine):
|
||||
i = Index( "ix_dataset_state", Dataset_table.c.state )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding index 'ix_dataset_state' to dataset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -103,12 +103,12 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = Job_table.c.library_folder_id
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'library_folder_id' from job table failed: %s" % ( str( e ) ) )
|
||||
# Drop the job_to_output_library_dataset table
|
||||
try:
|
||||
JobToOutputLibraryDatasetAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping job_to_output_library_dataset table failed: %s" % str( e ) )
|
||||
# Drop the ix_dataset_state index
|
||||
@@ -120,6 +120,6 @@ def downgrade(migrate_engine):
|
||||
i = Index( "ix_dataset_state", Dataset_table.c.state )
|
||||
try:
|
||||
i.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping index 'ix_dataset_state' from dataset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -32,7 +32,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
UserPreference_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating user_preference table failed: %s" % str( e ) )
|
||||
|
||||
@@ -42,6 +42,6 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
UserPreference_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping user_preference table failed: %s" % str( e ) )
|
||||
|
||||
@@ -42,7 +42,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "form_values_id", Integer, index=True )
|
||||
col.create( User_table, index_name='ix_user_form_values_id')
|
||||
assert col is User_table.c.form_values_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'form_values_id' to galaxy_user table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
FormValues_table = Table( "form_values", metadata, autoload=True )
|
||||
@@ -58,7 +58,7 @@ def upgrade(migrate_engine):
|
||||
name='user_form_values_id_fk' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'user_form_values_id_fk' to table 'galaxy_user' failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ def upgrade(migrate_engine):
|
||||
# Add new request_event table
|
||||
try:
|
||||
RequestEvent_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_event table failed: %s" % str( e ) )
|
||||
# move the current state of all existing requests to the request_event table
|
||||
|
||||
@@ -89,7 +89,7 @@ def upgrade(migrate_engine):
|
||||
if Request_table is not None:
|
||||
try:
|
||||
Request_table.c.state.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'state' to request table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "filename_override_metadata", String( 255 ) )
|
||||
col.create( job_external_output_metadata )
|
||||
assert col is job_external_output_metadata.c.filename_override_metadata
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'filename_override_metadata' to job_external_output_metadata table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
UserAction_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating user_action table failed: %s" % str( e ) )
|
||||
|
||||
@@ -44,6 +44,6 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
UserAction_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping user_action table failed: %s" % str( e ) )
|
||||
|
||||
@@ -43,7 +43,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( HistoryTagAssociation_table, index_name='ix_history_tag_association_user_id')
|
||||
assert c is HistoryTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to history_tag_association table failed: %s" % str( e ) )
|
||||
@@ -52,7 +52,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( HistoryTagAssociation_table)
|
||||
assert c is HistoryTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to history_tag_association table failed: %s" % str( e ) )
|
||||
@@ -69,7 +69,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( HistoryDatasetAssociationTagAssociation_table, index_name='ix_history_dataset_association_tag_association_user_id')
|
||||
assert c is HistoryDatasetAssociationTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
@@ -81,7 +81,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( HistoryDatasetAssociationTagAssociation_table)
|
||||
assert c is HistoryDatasetAssociationTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
@@ -97,7 +97,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( PageTagAssociation_table, index_name='ix_page_tag_association_user_id')
|
||||
assert c is PageTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to page_tag_association table failed: %s" % str( e ) )
|
||||
@@ -108,7 +108,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( PageTagAssociation_table )
|
||||
assert c is PageTagAssociation_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# SQLite does not support 'ALTER TABLE ADD FOREIGN KEY', so catch exception if it arises.
|
||||
print str(e)
|
||||
log.debug( "Adding user_id column to page_tag_association table failed: %s" % str( e ) )
|
||||
@@ -121,14 +121,14 @@ def upgrade(migrate_engine):
|
||||
# Create stored_workflow_tag_association table.
|
||||
try:
|
||||
StoredWorkflowTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating stored_workflow_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create workflow_tag_association table.
|
||||
try:
|
||||
WorkflowTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating workflow_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -141,7 +141,7 @@ def downgrade(migrate_engine):
|
||||
HistoryTagAssociation_table = Table( "history_tag_association", metadata, autoload=True )
|
||||
try:
|
||||
HistoryTagAssociation_table.c.user_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping column user_id from history_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -149,7 +149,7 @@ def downgrade(migrate_engine):
|
||||
HistoryDatasetAssociationTagAssociation_table = Table( "history_dataset_association_tag_association", metadata, autoload=True )
|
||||
try:
|
||||
HistoryDatasetAssociationTagAssociation_table.c.user_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping column user_id from history_dataset_association_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -157,20 +157,20 @@ def downgrade(migrate_engine):
|
||||
PageTagAssociation_table = Table( "page_tag_association", metadata, autoload=True )
|
||||
try:
|
||||
PageTagAssociation_table.c.user_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping column user_id from page_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop stored_workflow_tag_association table.
|
||||
try:
|
||||
StoredWorkflowTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping stored_workflow_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop workflow_tag_association table.
|
||||
try:
|
||||
WorkflowTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping workflow_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
+6
-6
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( History_table, index_name='ix_history_published')
|
||||
assert c is History_table.c.published
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding published column to history table failed: %s" % str( e )
|
||||
log.debug( "Adding published column to history table failed: %s" % str( e ) )
|
||||
|
||||
@@ -40,7 +40,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( StoredWorkflow_table, index_name='ix_stored_workflow_published')
|
||||
assert c is StoredWorkflow_table.c.published
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding published column to stored_workflow table failed: %s" % str( e )
|
||||
log.debug( "Adding published column to stored_workflow table failed: %s" % str( e ) )
|
||||
|
||||
@@ -59,7 +59,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( Page_table, index_name='ix_page_importable')
|
||||
assert c is Page_table.c.importable
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding importable column to page table failed: %s" % str( e )
|
||||
log.debug( "Adding importable column to page table failed: %s" % str( e ) )
|
||||
|
||||
@@ -81,7 +81,7 @@ def downgrade(migrate_engine):
|
||||
History_table = Table( "history", metadata, autoload=True )
|
||||
try:
|
||||
History_table.c.published.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping column published from history table failed: %s" % str( e )
|
||||
log.debug( "Dropping column published from history table failed: %s" % str( e ) )
|
||||
|
||||
@@ -89,7 +89,7 @@ def downgrade(migrate_engine):
|
||||
StoredWorkflow_table = Table( "stored_workflow", metadata, autoload=True )
|
||||
try:
|
||||
StoredWorkflow_table.c.published.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping column published from stored_workflow table failed: %s" % str( e )
|
||||
log.debug( "Dropping column published from stored_workflow table failed: %s" % str( e ) )
|
||||
|
||||
@@ -97,6 +97,6 @@ def downgrade(migrate_engine):
|
||||
Page_table = Table( "page", metadata, autoload=True )
|
||||
try:
|
||||
Page_table.c.importable.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping column importable from page table failed: %s" % str( e )
|
||||
log.debug( "Dropping column importable from page table failed: %s" % str( e ) )
|
||||
|
||||
@@ -22,7 +22,7 @@ def upgrade(migrate_engine):
|
||||
# Create stored_workflow_tag_association table.
|
||||
try:
|
||||
PageUserShareAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating page_user_share_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -34,6 +34,6 @@ def downgrade(migrate_engine):
|
||||
# Drop workflow_tag_association table.
|
||||
try:
|
||||
PageUserShareAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping page_user_share_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -54,35 +54,35 @@ def upgrade(migrate_engine):
|
||||
# Create history_annotation_association table.
|
||||
try:
|
||||
HistoryAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create history_dataset_association_annotation_association table.
|
||||
try:
|
||||
HistoryDatasetAssociationAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_dataset_association_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create stored_workflow_annotation_association table.
|
||||
try:
|
||||
StoredWorkflowAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating stored_workflow_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create workflow_step_annotation_association table.
|
||||
try:
|
||||
WorkflowStepAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating workflow_step_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create workflow_step_tag_association table.
|
||||
try:
|
||||
WorkflowStepTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating workflow_step_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -96,7 +96,7 @@ def upgrade(migrate_engine):
|
||||
hdaaa.create()
|
||||
swaaa.create()
|
||||
wsaaa.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating annotation indices failed: %s" % str( e ) )
|
||||
|
||||
@@ -108,34 +108,34 @@ def downgrade(migrate_engine):
|
||||
# Drop history_annotation_association table.
|
||||
try:
|
||||
HistoryAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop history_dataset_association_annotation_association table.
|
||||
try:
|
||||
HistoryDatasetAssociationAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_dataset_association_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop stored_workflow_annotation_association table.
|
||||
try:
|
||||
StoredWorkflowAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping stored_workflow_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop workflow_step_annotation_association table.
|
||||
try:
|
||||
WorkflowStepAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping workflow_step_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop workflow_step_tag_association table.
|
||||
try:
|
||||
WorkflowStepTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping workflow_step_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ def upgrade(migrate_engine):
|
||||
cmd = "UPDATE library_info_association SET deleted = %s" % get_false_value(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "deleted to false in library_info_association failed: %s" % ( str( e ) ) )
|
||||
|
||||
LibraryFolderInfoAssociation_table = Table( "library_folder_info_association", metadata, autoload=True )
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
cmd = "UPDATE library_folder_info_association SET deleted = %s" % get_false_value(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "deleted to false in library_folder_info_association failed: %s" % ( str( e ) ) )
|
||||
|
||||
LibraryDatasetDatasetInfoAssociation_table = Table( "library_dataset_dataset_info_association", metadata, autoload=True )
|
||||
@@ -49,7 +49,7 @@ def upgrade(migrate_engine):
|
||||
cmd = "UPDATE library_dataset_dataset_info_association SET deleted = %s" % get_false_value(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "deleted to false in library_dataset_dataset_info_association failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "datatx_info", JSONType() )
|
||||
col.create( RequestType_table )
|
||||
assert col is RequestType_table.c.datatx_info
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'datatx_info' to request_type table failed: %s" % ( str( e ) ) )
|
||||
# request table
|
||||
try:
|
||||
@@ -68,7 +68,7 @@ def upgrade(migrate_engine):
|
||||
Column( "deleted", Boolean, index=True, default=False ) )
|
||||
try:
|
||||
RequestTemp_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_temp table failed: %s" % str( e ) )
|
||||
# insert all the rows from the request table to the request_temp table
|
||||
cmd = "INSERT INTO request_temp SELECT id, create_time, " + \
|
||||
@@ -78,7 +78,7 @@ def upgrade(migrate_engine):
|
||||
# delete the 'request' table
|
||||
try:
|
||||
Request_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping request table failed: %s" % str( e ) )
|
||||
# rename table request_temp to request
|
||||
cmd = "ALTER TABLE request_temp RENAME TO request"
|
||||
@@ -87,12 +87,12 @@ def upgrade(migrate_engine):
|
||||
# Delete the library_id column in 'request' table
|
||||
try:
|
||||
Request_table.c.library_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'library_id' to request table failed: %s" % ( str( e ) ) )
|
||||
# Delete the folder_id column in 'request' table
|
||||
try:
|
||||
Request_table.c.folder_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'folder_id' to request table failed: %s" % ( str( e ) ) )
|
||||
# sample table
|
||||
try:
|
||||
@@ -106,7 +106,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "dataset_files", JSONType() )
|
||||
col.create( Sample_table )
|
||||
assert col is Sample_table.c.dataset_files
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'dataset_files' to sample table failed: %s" % ( str( e ) ) )
|
||||
# library table
|
||||
try:
|
||||
@@ -123,7 +123,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "library_id", Integer, index=True )
|
||||
col.create( Sample_table, index_name='ix_sample_library_id')
|
||||
assert col is Sample_table.c.library_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'library_id' to sample table failed: %s" % ( str( e ) ) )
|
||||
# library_folder table
|
||||
try:
|
||||
@@ -140,7 +140,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "folder_id", Integer, index=True )
|
||||
col.create( Sample_table, index_name='ix_sample_library_folder_id')
|
||||
assert col is Sample_table.c.folder_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'folder_id' to sample table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -48,7 +48,7 @@ def upgrade(migrate_engine):
|
||||
Column( "deleted", Boolean, index=True, default=False ) )
|
||||
try:
|
||||
Request_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request table failed: %s" % str( e ) )
|
||||
|
||||
metadata.reflect()
|
||||
@@ -60,7 +60,7 @@ def upgrade(migrate_engine):
|
||||
cmd = "UPDATE library_info_association SET inheritable = %s" % get_false_value(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Setting value of column inheritable to false in library_info_association failed: %s" % ( str( e ) ) )
|
||||
|
||||
LibraryFolderInfoAssociation_table = Table( "library_folder_info_association", metadata, autoload=True )
|
||||
@@ -70,7 +70,7 @@ def upgrade(migrate_engine):
|
||||
cmd = "UPDATE library_folder_info_association SET inheritable = %s" % get_false_value(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Setting value of column inheritable to false in library_folder_info_association failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def upgrade(migrate_engine):
|
||||
# Create history_annotation_association table.
|
||||
try:
|
||||
PageAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating page_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -35,6 +35,6 @@ def downgrade(migrate_engine):
|
||||
# Drop page_annotation_association table.
|
||||
try:
|
||||
PageAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping page_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
+16
-16
@@ -44,7 +44,7 @@ def upgrade(migrate_engine):
|
||||
# Create visualization_user_share_association table.
|
||||
try:
|
||||
VisualizationUserShareAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Creating visualization_user_share_association table failed: %s" % str( e )
|
||||
log.debug( "Creating visualization_user_share_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -68,7 +68,7 @@ def upgrade(migrate_engine):
|
||||
# Fill column with default value.
|
||||
cmd = "UPDATE visualization SET deleted = %s" % default_false
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding deleted column to visualization table failed: %s" % str( e )
|
||||
log.debug( "Adding deleted column to visualization table failed: %s" % str( e ) )
|
||||
|
||||
@@ -80,14 +80,14 @@ def upgrade(migrate_engine):
|
||||
# Fill column with default value.
|
||||
cmd = "UPDATE visualization SET importable = %s" % default_false
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding importable column to visualization table failed: %s" % str( e )
|
||||
log.debug( "Adding importable column to visualization table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
slug_column.create( Visualiation_table )
|
||||
assert slug_column is Visualiation_table.c.slug
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding slug column to visualization table failed: %s" % str( e )
|
||||
log.debug( "Adding slug column to visualization table failed: %s" % str( e ) )
|
||||
|
||||
@@ -99,7 +99,7 @@ def upgrade(migrate_engine):
|
||||
else:
|
||||
i = Index( "ix_visualization_slug", Visualiation_table.c.slug )
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding index 'ix_visualization_slug' failed: %s" % str( e )
|
||||
log.debug( "Adding index 'ix_visualization_slug' failed: %s" % str( e ) )
|
||||
|
||||
@@ -111,21 +111,21 @@ def upgrade(migrate_engine):
|
||||
# Fill column with default value.
|
||||
cmd = "UPDATE visualization SET published = %s" % default_false
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding published column to visualization table failed: %s" % str( e )
|
||||
log.debug( "Adding published column to visualization table failed: %s" % str( e ) )
|
||||
|
||||
# Create visualization_tag_association table.
|
||||
try:
|
||||
VisualizationTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating visualization_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create visualization_annotation_association table.
|
||||
try:
|
||||
VisualizationAnnotationAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating visualization_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -138,7 +138,7 @@ def upgrade(migrate_engine):
|
||||
else:
|
||||
i = Index( "ix_visualization_annotation_association_annotation", VisualizationAnnotationAssociation_table.c.annotation )
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding index 'ix_visualization_annotation_association_annotation' failed: %s" % str( e )
|
||||
log.debug( "Adding index 'ix_visualization_annotation_association_annotation' failed: %s" % str( e ) )
|
||||
|
||||
@@ -151,45 +151,45 @@ def downgrade(migrate_engine):
|
||||
# Drop visualization_user_share_association table.
|
||||
try:
|
||||
VisualizationUserShareAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping visualization_user_share_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop columns for supporting sharing from visualization table.
|
||||
try:
|
||||
Visualiation_table.c.deleted.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping deleted column from visualization table failed: %s" % str( e )
|
||||
log.debug( "Dropping deleted column from visualization table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
Visualiation_table.c.importable.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping importable column from visualization table failed: %s" % str( e )
|
||||
log.debug( "Dropping importable column from visualization table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
Visualiation_table.c.slug.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping slug column from visualization table failed: %s" % str( e )
|
||||
log.debug( "Dropping slug column from visualization table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
Visualiation_table.c.published.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping published column from visualization table failed: %s" % str( e )
|
||||
log.debug( "Dropping published column from visualization table failed: %s" % str( e ) )
|
||||
|
||||
# Drop visualization_tag_association table.
|
||||
try:
|
||||
VisualizationTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping visualization_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop visualization_annotation_association table.
|
||||
try:
|
||||
VisualizationAnnotationAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping visualization_annotation_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -25,7 +25,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
RequestTypePermissions_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_type_permissions table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ def upgrade(migrate_engine):
|
||||
col = Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=True )
|
||||
col.create( Job_table, index_name='ix_job_user_id' )
|
||||
assert col is Job_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'user_id' to job table failed: %s" % ( str( e ) ) )
|
||||
else:
|
||||
try:
|
||||
col = Column( "user_id", Integer, nullable=True)
|
||||
col.create( Job_table )
|
||||
assert col is Job_table.c.user_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'user_id' to job table failed: %s" % ( str( e ) ) )
|
||||
try:
|
||||
cmd = "SELECT job.id AS galaxy_job_id, " \
|
||||
@@ -62,7 +62,7 @@ def upgrade(migrate_engine):
|
||||
print "Updated the user_id column for ", update_count, " rows in the job table. "
|
||||
print len( job_users ) - update_count, " rows have no user_id since the value was NULL in the galaxy_session table."
|
||||
print ""
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Updating job.user_id column failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -78,5 +78,5 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = Job_table.c.user_id
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'user_id' from job table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -41,7 +41,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "state", TrimmedString( 64 ), index=True, nullable=True )
|
||||
col.create( dataset_instance_table, index_name=index_name)
|
||||
assert col is dataset_instance_table.c.state
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding column 'state' to %s table failed: %s" % ( table_name, str( e ) ) )
|
||||
|
||||
|
||||
@@ -59,5 +59,5 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
col = dataset_instance_table.c.state
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'state' from %s table failed: %s" % ( table_name, str( e ) ) )
|
||||
|
||||
@@ -25,7 +25,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
APIKeys_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating api_keys table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -35,5 +35,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
APIKeys_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping api_keys table failed: %s" % str( e ) )
|
||||
|
||||
@@ -137,7 +137,7 @@ def upgrade(migrate_engine):
|
||||
UCI_table.drop()
|
||||
CloudUserCredentials_table.drop()
|
||||
CloudProvider_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping cloud tables failed: %s" % str( e ) )
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def upgrade(migrate_engine):
|
||||
default_false = "false"
|
||||
migrate_engine.execute( "UPDATE job SET imported=%s" % default_false )
|
||||
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding imported column to job table failed: %s" % str( e )
|
||||
log.debug( "Adding imported column to job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -42,6 +42,6 @@ def downgrade(migrate_engine):
|
||||
Jobs_table = Table( "job", metadata, autoload=True )
|
||||
try:
|
||||
Jobs_table.c.imported.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping column imported from job table failed: %s" % str( e )
|
||||
log.debug( "Dropping column imported from job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -51,7 +51,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
SampleDataset_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating sample_dataset table failed: %s" % str( e ) )
|
||||
|
||||
cmd = "SELECT id, dataset_files FROM sample"
|
||||
@@ -83,7 +83,7 @@ def upgrade(migrate_engine):
|
||||
if Sample_table is not None:
|
||||
try:
|
||||
Sample_table.c.dataset_files.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'dataset_files' from the 'sample' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -49,21 +49,21 @@ def upgrade(migrate_engine):
|
||||
# Create history_rating_association table.
|
||||
try:
|
||||
HistoryRatingAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create history_dataset_association_rating_association table.
|
||||
try:
|
||||
HistoryDatasetAssociationRatingAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# MySQL cannot handle long index names; when we see this error, create the index name manually.
|
||||
if migrate_engine.name == 'mysql' and \
|
||||
str(e).lower().find("identifier name 'ix_history_dataset_association_rating_association_history_dataset_association_id' is too long"):
|
||||
i = Index( "ix_hda_rating_association_hda_id", HistoryDatasetAssociationRatingAssociation_table.c.history_dataset_association_id )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding index 'ix_hda_rating_association_hda_id' to table 'history_dataset_association_rating_association' table failed: %s" % str( e ) )
|
||||
else:
|
||||
@@ -73,21 +73,21 @@ def upgrade(migrate_engine):
|
||||
# Create stored_workflow_rating_association table.
|
||||
try:
|
||||
StoredWorkflowRatingAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating stored_workflow_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create page_rating_association table.
|
||||
try:
|
||||
PageRatingAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating page_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create visualization_rating_association table.
|
||||
try:
|
||||
VisualizationRatingAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating visualization_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -99,34 +99,34 @@ def downgrade(migrate_engine):
|
||||
# Drop history_rating_association table.
|
||||
try:
|
||||
HistoryRatingAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop history_dataset_association_rating_association table.
|
||||
try:
|
||||
HistoryDatasetAssociationRatingAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_dataset_association_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop stored_workflow_rating_association table.
|
||||
try:
|
||||
StoredWorkflowRatingAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping stored_workflow_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop page_rating_association table.
|
||||
try:
|
||||
PageRatingAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping page_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop visualization_rating_association table.
|
||||
try:
|
||||
VisualizationRatingAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping visualization_rating_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -22,7 +22,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
PostJobActionAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating PostJobActionAssociation table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -32,5 +32,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
PostJobActionAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping PostJobActionAssociation table failed: %s" % str( e ) )
|
||||
|
||||
@@ -32,7 +32,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "notification", JSONType() )
|
||||
col.create( Request_table )
|
||||
assert col is Request_table.c.notification
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'notification' in the 'request' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
cmd = "SELECT id, user_id, notify FROM request"
|
||||
@@ -47,7 +47,7 @@ def upgrade(migrate_engine):
|
||||
if migrate_engine.name != 'sqlite':
|
||||
try:
|
||||
Request_table.c.notify.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'notify' from the 'request' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def upgrade(migrate_engine):
|
||||
# Create job_export_history_archive table.
|
||||
try:
|
||||
JobExportHistoryArchive_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating job_export_history_archive table failed: %s" % str( e ) )
|
||||
|
||||
@@ -41,6 +41,6 @@ def downgrade(migrate_engine):
|
||||
# Drop job_export_history_archive table.
|
||||
try:
|
||||
JobExportHistoryArchive_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping job_export_history_archive table failed: %s" % str( e ) )
|
||||
|
||||
@@ -33,14 +33,14 @@ def upgrade(migrate_engine):
|
||||
# remove the 'file_path' column
|
||||
try:
|
||||
SampleDataset_table.c.file_path.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'file_path' from the 'sample_dataset' table failed: %s" % ( str( e ) ) )
|
||||
# create the column again
|
||||
try:
|
||||
col = Column( "file_path", TEXT )
|
||||
col.create( SampleDataset_table )
|
||||
assert col is SampleDataset_table.c.file_path
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'file_path' in the 'sample_dataset' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
for id, file_path in filepath_dict.items():
|
||||
|
||||
@@ -40,14 +40,14 @@ def upgrade(migrate_engine):
|
||||
elif migrate_engine.name in ['postgres', 'postgresql']:
|
||||
default_false = "false"
|
||||
migrate_engine.execute( "UPDATE history SET importing=%s" % default_false )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding column 'importing' to history table failed: %s" % str( e ) )
|
||||
|
||||
# Create job_import_history_archive table.
|
||||
try:
|
||||
JobImportHistoryArchive_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating job_import_history_archive table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ def downgrade(migrate_engine):
|
||||
History_table = Table( "history", metadata, autoload=True )
|
||||
importing_col = History_table.c.importing
|
||||
importing_col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'importing' from history table failed: %s" % ( str( e ) ) )
|
||||
|
||||
# Drop job_import_history_archive table.
|
||||
try:
|
||||
JobImportHistoryArchive_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping job_import_history_archive table failed: %s" % str( e ) )
|
||||
|
||||
@@ -30,7 +30,7 @@ def upgrade(migrate_engine):
|
||||
# Create galaxy_user_openid table
|
||||
try:
|
||||
UserOpenID_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating galaxy_user_openid table failed: %s" % str( e ) )
|
||||
|
||||
ix_name = 'ix_galaxy_user_openid_openid'
|
||||
@@ -41,7 +41,7 @@ def upgrade(migrate_engine):
|
||||
i = Index( ix_name, UserOpenID_table.c.openid, unique=True )
|
||||
try:
|
||||
i.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding index '%s' failed: %s" % ( ix_name, str( e ) ) )
|
||||
|
||||
|
||||
@@ -52,5 +52,5 @@ def downgrade(migrate_engine):
|
||||
# Drop galaxy_user_openid table
|
||||
try:
|
||||
UserOpenID_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping galaxy_user_openid table failed: %s" % str( e ) )
|
||||
|
||||
@@ -34,7 +34,7 @@ def upgrade(migrate_engine):
|
||||
# create the sequencer table
|
||||
try:
|
||||
Sequencer_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating 'sequencer' table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -50,5 +50,5 @@ def downgrade(migrate_engine):
|
||||
if Sequencer_table:
|
||||
try:
|
||||
Sequencer_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting 'sequencer' table failed: %s" % str( e ) )
|
||||
|
||||
@@ -35,15 +35,15 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
Run_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating Run_table table failed: %s" % str( e ) )
|
||||
try:
|
||||
RequestTypeRunAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating RequestTypeRunAssociation table failed: %s" % str( e ) )
|
||||
try:
|
||||
SampleRunAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating SampleRunAssociation table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -53,13 +53,13 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
SampleRunAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping SampleRunAssociation table failed: %s" % str( e ) )
|
||||
try:
|
||||
RequestTypeRunAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping RequestTypeRunAssociation table failed: %s" % str( e ) )
|
||||
try:
|
||||
Run_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping Run_table table failed: %s" % str( e ) )
|
||||
|
||||
@@ -29,11 +29,11 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
Table( "form_definition", metadata, autoload=True )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Loading 'form_definition' table failed: %s" % str( e ) )
|
||||
try:
|
||||
Table( "form_values", metadata, autoload=True )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Loading 'form_values' table failed: %s" % str( e ) )
|
||||
|
||||
def get_value(lst, index):
|
||||
@@ -91,11 +91,11 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
Table( "form_definition", metadata, autoload=True )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Loading 'form_definition' table failed: %s" % str( e ) )
|
||||
try:
|
||||
Table( "form_values", metadata, autoload=True )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Loading 'form_values' table failed: %s" % str( e ) )
|
||||
# remove the name attribute in the content column JSON dict in the form_values table
|
||||
# and restore it to a list of values
|
||||
|
||||
@@ -40,13 +40,13 @@ def upgrade(migrate_engine):
|
||||
# Create deferred_job table
|
||||
try:
|
||||
DeferredJob_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Creating deferred_job table failed: %s" % str( e ) )
|
||||
|
||||
# Create transfer_job table
|
||||
try:
|
||||
TransferJob_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Creating transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -57,11 +57,11 @@ def downgrade(migrate_engine):
|
||||
# Drop deferred_job table
|
||||
try:
|
||||
DeferredJob_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Dropping deferred_job table failed: %s" % str( e ) )
|
||||
|
||||
# Drop transfer_job table
|
||||
try:
|
||||
TransferJob_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Dropping transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -211,7 +211,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "sequencer_id", Integer, ForeignKey( "sequencer.id" ), nullable=True )
|
||||
col.create( RequestType_table )
|
||||
assert col is RequestType_table.c.sequencer_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'sequencer_id' in the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
# copy the sequencer information contained in the 'datatx_info' column
|
||||
# of the request_type table to the form values referenced in the sequencer table
|
||||
@@ -249,7 +249,7 @@ def upgrade(migrate_engine):
|
||||
# Finally delete the 'datatx_info' column from the request_type table
|
||||
try:
|
||||
RequestType_table.c.datatx_info.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'datatx_info' in the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ def downgrade(migrate_engine):
|
||||
col = Column( "datatx_info", JSONType() )
|
||||
col.create( RequestType_table )
|
||||
assert col is RequestType_table.c.datatx_info
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'datatx_info' in the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
# restore the datatx_info column data in the request_type table with data from
|
||||
# the sequencer and the form_values table
|
||||
@@ -291,5 +291,5 @@ def downgrade(migrate_engine):
|
||||
# delete foreign key field to the sequencer table in the request_type table
|
||||
try:
|
||||
RequestType_table.c.sequencer_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'sequencer_id' in the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -56,7 +56,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "external_service_id", Integer, index=True )
|
||||
col.create( SampleDataset_table, index_name="ix_sample_dataset_external_service_id" )
|
||||
assert col is SampleDataset_table.c.external_service_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'external_service_id' in the 'sample_dataset' table failed: %s" % ( str( e ) ) )
|
||||
if migrate_engine.name != 'sqlite':
|
||||
# Add the foreign key constraint
|
||||
@@ -66,7 +66,7 @@ def upgrade(migrate_engine):
|
||||
name='sample_dataset_external_services_id_fk' )
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Adding foreign key constraint 'sample_dataset_external_services_id_fk' to table 'sample_dataset' failed: %s" % ( str( e ) ) )
|
||||
# populate the column
|
||||
cmd = "SELECT sample_dataset.id, request_type.sequencer_id " \
|
||||
@@ -107,7 +107,7 @@ def upgrade(migrate_engine):
|
||||
col = Column( "external_service_type_id", TrimmedString( 255 ) )
|
||||
col.create( ExternalServices_table )
|
||||
assert col is ExternalServices_table.c.external_service_type_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'external_service_type_id' in the 'external_service' table failed: %s" % ( str( e ) ) )
|
||||
# populate this new column
|
||||
cmd = "UPDATE external_service SET external_service_type_id=sequencer_type_id"
|
||||
@@ -115,7 +115,7 @@ def upgrade(migrate_engine):
|
||||
# remove the 'sequencer_type_id' column
|
||||
try:
|
||||
ExternalServices_table.c.sequencer_type_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'sequencer_type_id' from the 'external_service' table failed: %s" % ( str( e ) ) )
|
||||
# create 'request_type_external_service_association' table
|
||||
RequestTypeExternalServiceAssociation_table = Table( "request_type_external_service_association", metadata,
|
||||
@@ -124,7 +124,7 @@ def upgrade(migrate_engine):
|
||||
Column( "external_service_id", Integer, ForeignKey( "external_service.id" ), index=True ) )
|
||||
try:
|
||||
RequestTypeExternalServiceAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_type_external_service_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
RequestTypeExternalServiceAssociation_table = Table( "request_type_external_service_association", metadata, autoload=True )
|
||||
@@ -165,7 +165,7 @@ def upgrade(migrate_engine):
|
||||
Column( "deleted", Boolean, index=True, default=False ) )
|
||||
try:
|
||||
RequestTypeTemp_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating request_type_temp table failed: %s" % str( e ) )
|
||||
# insert all the rows from the request table to the request_temp table
|
||||
cmd = "INSERT INTO request_type_temp SELECT id, create_time," + \
|
||||
@@ -175,7 +175,7 @@ def upgrade(migrate_engine):
|
||||
# delete the 'request_type' table
|
||||
try:
|
||||
RequestType_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping request_type table failed: %s" % str( e ) )
|
||||
# rename table request_temp to request
|
||||
cmd = "ALTER TABLE request_type_temp RENAME TO request_type"
|
||||
@@ -183,7 +183,7 @@ def upgrade(migrate_engine):
|
||||
else:
|
||||
try:
|
||||
RequestType_table.c.sequencer_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'sequencer_id' from the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ def downgrade(migrate_engine):
|
||||
col = Column( "sequencer_id", Integer, ForeignKey( "external_service.id" ), nullable=True, index=True )
|
||||
col.create( RequestType_table )
|
||||
assert col is RequestType_table.c.sequencer_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'sequencer_id' in the 'request_type' table failed: %s" % ( str( e ) ) )
|
||||
# populate 'sequencer_id' column in the 'request_type' table from the
|
||||
# 'request_type_external_service_association' table
|
||||
@@ -234,7 +234,7 @@ def downgrade(migrate_engine):
|
||||
if RequestTypeExternalServiceAssociation_table is not None:
|
||||
try:
|
||||
RequestTypeExternalServiceAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting 'request_type_external_service_association' table failed: %s" % str( e ) )
|
||||
# rename 'external_service_type_id' column to 'sequencer_type_id' in the table 'external_service'
|
||||
# create the column 'sequencer_type_id'
|
||||
@@ -242,7 +242,7 @@ def downgrade(migrate_engine):
|
||||
col = Column( "sequencer_type_id", TrimmedString( 255 ) )
|
||||
col.create( ExternalServices_table )
|
||||
assert col is ExternalServices_table.c.sequencer_type_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating column 'sequencer_type_id' in the 'external_service' table failed: %s" % ( str( e ) ) )
|
||||
# populate this new column
|
||||
cmd = "UPDATE external_service SET sequencer_type_id=external_service_type_id"
|
||||
@@ -250,7 +250,7 @@ def downgrade(migrate_engine):
|
||||
# remove the 'external_service_type_id' column
|
||||
try:
|
||||
ExternalServices_table.c.external_service_type_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'external_service_type_id' from the 'external_service' table failed: %s" % ( str( e ) ) )
|
||||
# rename the 'external_service' table to 'sequencer'
|
||||
cmd = "ALTER TABLE external_service RENAME TO sequencer"
|
||||
@@ -269,5 +269,5 @@ def downgrade(migrate_engine):
|
||||
return
|
||||
try:
|
||||
SampleDataset_table.c.external_service_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'external_service_id' from the 'sample_dataset' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -18,7 +18,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "info", TEXT )
|
||||
c.create( TransferJob_table )
|
||||
assert c is TransferJob_table.c.info
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding info column to transfer_job table failed: %s" % str( e )
|
||||
log.debug( "Adding info column to transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -29,6 +29,6 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
TransferJob_table = Table( "transfer_job", metadata, autoload=True )
|
||||
TransferJob_table.c.info.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping info column from transfer_job table failed: %s" % str( e )
|
||||
log.debug( "Dropping info column from transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -23,7 +23,7 @@ def upgrade(migrate_engine):
|
||||
c2.create( Sample_table )
|
||||
assert c1 is Sample_table.c.workflow
|
||||
assert c2 is Sample_table.c.history_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding history and workflow columns to sample table failed: %s" % str( e )
|
||||
log.debug( "Adding history and workflow columns to sample table failed: %s" % str( e ) )
|
||||
|
||||
@@ -34,12 +34,12 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
Sample_table = Table( "sample", metadata, autoload=True )
|
||||
Sample_table.c.workflow.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping workflow column from sample table failed: %s" % str( e )
|
||||
log.debug( "Dropping workflow column from sample table failed: %s" % str( e ) )
|
||||
try:
|
||||
Sample_table = Table( "sample", metadata, autoload=True )
|
||||
Sample_table.c.history_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping history column from sample table failed: %s" % str( e )
|
||||
log.debug( "Dropping history column from sample table failed: %s" % str( e ) )
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "socket", Integer )
|
||||
c.create( TransferJob_table )
|
||||
assert c is TransferJob_table.c.socket
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding columns to transfer_job table failed: %s" % str( e )
|
||||
log.debug( "Adding columns to transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -33,6 +33,6 @@ def downgrade(migrate_engine):
|
||||
TransferJob_table = Table( "transfer_job", metadata, autoload=True )
|
||||
TransferJob_table.c.pid.drop()
|
||||
TransferJob_table.c.socket.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping columns from transfer_job table failed: %s" % str( e )
|
||||
log.debug( "Dropping columns from transfer_job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -22,7 +22,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "ldda_parent_id", Integer, index=True, nullable=True )
|
||||
c.create( Implicitly_converted_table, index_name="ix_implicitly_converted_dataset_assoc_ldda_parent_id")
|
||||
assert c is Implicitly_converted_table.c.ldda_parent_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding ldda_parent_id column to implicitly_converted_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Adding ldda_parent_id column to implicitly_converted_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -33,6 +33,6 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
Implicitly_converted_table = Table( "implicitly_converted_dataset_association", metadata, autoload=True )
|
||||
Implicitly_converted_table.c.ldda_parent_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping ldda_parent_id column from implicitly_converted_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Dropping ldda_parent_id column from implicitly_converted_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
+3
-3
@@ -36,13 +36,13 @@ def upgrade(migrate_engine):
|
||||
c = Column( "purged", Boolean, index=True, default=False )
|
||||
c.create( LibraryDataset_table, index_name='ix_library_dataset_purged')
|
||||
assert c is LibraryDataset_table.c.purged
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding purged column to library_dataset table failed: ", str( e )
|
||||
# Update the purged flag to the default False
|
||||
cmd = "UPDATE library_dataset SET purged = %s;" % boolean_false(migrate_engine)
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Setting default data for library_dataset.purged column failed: %s" % ( str( e ) ) )
|
||||
|
||||
# Update the purged flag for those LibaryDatasets whose purged flag should be True. This happens
|
||||
@@ -64,5 +64,5 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
LibraryDataset_table = Table( "library_dataset", metadata, autoload=True )
|
||||
LibraryDataset_table.c.purged.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping purged column from library_dataset table failed: ", str( e )
|
||||
|
||||
@@ -17,7 +17,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "subindex", TrimmedString( 255 ), index=True )
|
||||
c.create( Run_table, index_name="ix_run_subindex")
|
||||
assert c is Run_table.c.subindex
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding the subindex column to the run table failed: ", str( e )
|
||||
|
||||
|
||||
@@ -27,5 +27,5 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
Run_table = Table( "run", metadata, autoload=True )
|
||||
Run_table.c.subindex.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping the subindex column from run table failed: ", str( e )
|
||||
|
||||
@@ -32,7 +32,7 @@ def upgrade(migrate_engine):
|
||||
# Create tool_tag_association table
|
||||
try:
|
||||
ToolTagAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Creating tool_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -43,5 +43,5 @@ def downgrade(migrate_engine):
|
||||
# Drop tool_tag_association table
|
||||
try:
|
||||
ToolTagAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.error( "Dropping tool_tag_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( 'total_size', Numeric( 15, 0 ) )
|
||||
c.create( Dataset_table )
|
||||
assert c is Dataset_table.c.total_size
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding total_size column to dataset table failed: %s" % str( e )
|
||||
log.debug( "Adding total_size column to dataset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
c.create( HistoryDatasetAssociation_table, index_name="ix_history_dataset_association_purged")
|
||||
assert c is HistoryDatasetAssociation_table.c.purged
|
||||
migrate_engine.execute(HistoryDatasetAssociation_table.update().values(purged=False))
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding purged column to history_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Adding purged column to history_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -40,7 +40,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( 'disk_usage', Numeric( 15, 0 ), index=True )
|
||||
c.create( User_table, index_name="ix_galaxy_user_disk_usage")
|
||||
assert c is User_table.c.disk_usage
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding disk_usage column to galaxy_user table failed: %s" % str( e )
|
||||
log.debug( "Adding disk_usage column to galaxy_user table failed: %s" % str( e ) )
|
||||
|
||||
@@ -49,7 +49,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( 'disk_usage', Numeric( 15, 0 ), index=True )
|
||||
c.create( GalaxySession_table, index_name="ix_galaxy_session_disk_usage")
|
||||
assert c is GalaxySession_table.c.disk_usage
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding disk_usage column to galaxy_session table failed: %s" % str( e )
|
||||
log.debug( "Adding disk_usage column to galaxy_session table failed: %s" % str( e ) )
|
||||
|
||||
@@ -60,27 +60,27 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
Dataset_table = Table( "dataset", metadata, autoload=True )
|
||||
Dataset_table.c.total_size.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping total_size column from dataset table failed: %s" % str( e )
|
||||
log.debug( "Dropping total_size column from dataset table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
HistoryDatasetAssociation_table = Table( "history_dataset_association", metadata, autoload=True )
|
||||
HistoryDatasetAssociation_table.c.purged.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping purged column from history_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Dropping purged column from history_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
User_table = Table( "galaxy_user", metadata, autoload=True )
|
||||
User_table.c.disk_usage.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping disk_usage column from galaxy_user table failed: %s" % str( e )
|
||||
log.debug( "Dropping disk_usage column from galaxy_user table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
GalaxySession_table = Table( "galaxy_session", metadata, autoload=True )
|
||||
GalaxySession_table.c.disk_usage.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping disk_usage column from galaxy_session table failed: %s" % str( e )
|
||||
log.debug( "Dropping disk_usage column from galaxy_session table failed: %s" % str( e ) )
|
||||
|
||||
@@ -24,7 +24,7 @@ def upgrade(migrate_engine):
|
||||
# Create the job_to_input_library_dataset table
|
||||
try:
|
||||
JobToInputLibraryDatasetAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Creating job_to_input_library_dataset table failed: %s" % str( e )
|
||||
log.debug( "Creating job_to_input_library_dataset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -36,6 +36,6 @@ def downgrade(migrate_engine):
|
||||
# Drop the job_to_input_library_dataset table
|
||||
try:
|
||||
JobToInputLibraryDatasetAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping job_to_input_library_dataset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -52,25 +52,25 @@ def upgrade(migrate_engine):
|
||||
# Create quota table
|
||||
try:
|
||||
Quota_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating quota table failed: %s" % str( e ) )
|
||||
|
||||
# Create user_quota_association table
|
||||
try:
|
||||
UserQuotaAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating user_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create group_quota_association table
|
||||
try:
|
||||
GroupQuotaAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating group_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
# Create default_quota_association table
|
||||
try:
|
||||
DefaultQuotaAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating default_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -81,23 +81,23 @@ def downgrade(migrate_engine):
|
||||
# Drop default_quota_association table
|
||||
try:
|
||||
DefaultQuotaAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping default_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop group_quota_association table
|
||||
try:
|
||||
GroupQuotaAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping group_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop user_quota_association table
|
||||
try:
|
||||
UserQuotaAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping user_quota_association table failed: %s" % str( e ) )
|
||||
|
||||
# Drop quota table
|
||||
try:
|
||||
Quota_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping quota table failed: %s" % str( e ) )
|
||||
|
||||
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
c.create( ldda_table )
|
||||
assert c is ldda_table.c.tool_version
|
||||
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding the tool_version column to the hda/ldda tables failed: ", str( e )
|
||||
|
||||
|
||||
@@ -34,5 +34,5 @@ def downgrade(migrate_engine):
|
||||
|
||||
ldda_table = Table( "library_dataset_dataset_association", metadata, autoload=True )
|
||||
ldda_table.c.tool_version.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping the tool_version column from hda/ldda table failed: ", str( e )
|
||||
|
||||
@@ -40,7 +40,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolShedRepository_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating tool_shed_repository table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -49,5 +49,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolShedRepository_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_shed_repository table failed: %s" % str( e ) )
|
||||
|
||||
@@ -18,7 +18,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "prepare_input_files_cmd", TEXT, nullable=True )
|
||||
c.create( task_table )
|
||||
assert c is task_table.c.prepare_input_files_cmd
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding prepare_input_files_cmd column to task table failed: %s" % str( e )
|
||||
log.debug( "Adding prepare_input_files_cmd column to task table failed: %s" % str( e ) )
|
||||
try:
|
||||
@@ -26,14 +26,14 @@ def upgrade(migrate_engine):
|
||||
c = Column( "working_directory", String( 1024 ), nullable=True )
|
||||
c.create( task_table )
|
||||
assert c is task_table.c.working_directory
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding working_directory column to task table failed: %s" % str( e )
|
||||
log.debug( "Adding working_directory column to task table failed: %s" % str( e ) )
|
||||
|
||||
# remove the 'part_file' column - nobody used tasks before this, so no data needs to be migrated
|
||||
try:
|
||||
task_table.c.part_file.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting column 'part_file' from the 'task' table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
@@ -43,13 +43,13 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
task_table = Table( "task", metadata, autoload=True )
|
||||
task_table.c.prepare_input_files_cmd.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping prepare_input_files_cmd column from task table failed: %s" % str( e )
|
||||
log.debug( "Dropping prepare_input_files_cmd column from task table failed: %s" % str( e ) )
|
||||
try:
|
||||
task_table = Table( "task", metadata, autoload=True )
|
||||
task_table.c.working_directory.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping working_directory column from task table failed: %s" % str( e )
|
||||
log.debug( "Dropping working_directory column from task table failed: %s" % str( e ) )
|
||||
try:
|
||||
@@ -57,6 +57,6 @@ def downgrade(migrate_engine):
|
||||
c = Column( "part_file", String( 1024 ), nullable=True )
|
||||
c.create( task_table )
|
||||
assert c is task_table.c.part_file
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding part_file column to task table failed: %s" % str( e )
|
||||
log.debug( "Adding part_file column to task table failed: %s" % str( e ) )
|
||||
|
||||
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "ldda_id", Integer, index=True, nullable=True )
|
||||
c.create( Implicitly_converted_table, index_name="ix_implicitly_converted_ds_assoc_ldda_id")
|
||||
assert c is Implicitly_converted_table.c.ldda_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding ldda_id column to implicitly_converted_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Adding ldda_id column to implicitly_converted_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -32,6 +32,6 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
Implicitly_converted_table = Table( "implicitly_converted_dataset_association", metadata, autoload=True )
|
||||
Implicitly_converted_table.c.ldda_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping ldda_id column from implicitly_converted_dataset_association table failed: %s" % str( e )
|
||||
log.debug( "Dropping ldda_id column from implicitly_converted_dataset_association table failed: %s" % str( e ) )
|
||||
|
||||
@@ -20,7 +20,7 @@ def upgrade(migrate_engine):
|
||||
c = Column( "info", TrimmedString(255), nullable=True )
|
||||
c.create( task_table )
|
||||
assert c is task_table.c.info
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding info column to table table failed: %s" % str( e )
|
||||
log.debug( "Adding info column to task table failed: %s" % str( e ) )
|
||||
|
||||
@@ -31,6 +31,6 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
task_table = Table( "task", metadata, autoload=True )
|
||||
task_table.c.info.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping info column from task table failed: %s" % str( e )
|
||||
log.debug( "Dropping info column from task table failed: %s" % str( e ) )
|
||||
|
||||
@@ -38,7 +38,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( ToolShedRepository_table )
|
||||
assert c is ToolShedRepository_table.c.metadata
|
||||
except Exception, e:
|
||||
except Exception as 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 )
|
||||
@@ -46,7 +46,7 @@ def upgrade(migrate_engine):
|
||||
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:
|
||||
except Exception as 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 )
|
||||
@@ -54,7 +54,7 @@ def upgrade(migrate_engine):
|
||||
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:
|
||||
except Exception as 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 ) )
|
||||
|
||||
@@ -65,16 +65,16 @@ def downgrade(migrate_engine):
|
||||
ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True )
|
||||
try:
|
||||
ToolShedRepository_table.c.metadata.drop()
|
||||
except Exception, e:
|
||||
except Exception as 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:
|
||||
except Exception as 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:
|
||||
except Exception as 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 ) )
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolIdGuidMap_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating tool_id_guid_map table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -48,5 +48,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolIdGuidMap_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_id_guid_map table failed: %s" % str( e ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
col.create( ToolShedRepository_table )
|
||||
assert col is ToolShedRepository_table.c.installed_changeset_revision
|
||||
except Exception, e:
|
||||
except Exception as 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.
|
||||
@@ -60,6 +60,6 @@ def downgrade(migrate_engine):
|
||||
ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True )
|
||||
try:
|
||||
ToolShedRepository_table.c.installed_changeset_revision.drop()
|
||||
except Exception, e:
|
||||
except Exception as 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 ) )
|
||||
|
||||
@@ -21,7 +21,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
c.create( t, index_name="ix_%s_object_store_id" % t_name)
|
||||
assert c is t.c.object_store_id
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding object_store_id column to %s table failed: %s" % ( t_name, str( e ) )
|
||||
log.debug( "Adding object_store_id column to %s table failed: %s" % ( t_name, str( e ) ) )
|
||||
|
||||
@@ -33,6 +33,6 @@ def downgrade(migrate_engine):
|
||||
t = Table( t_name, metadata, autoload=True )
|
||||
try:
|
||||
t.c.object_store_id.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping object_store_id column from %s table failed: %s" % ( t_name, str( e ) )
|
||||
log.debug( "Dropping object_store_id column from %s table failed: %s" % ( t_name, str( e ) ) )
|
||||
|
||||
@@ -36,14 +36,14 @@ def upgrade(migrate_engine):
|
||||
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:
|
||||
except Exception as 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:
|
||||
except Exception as e:
|
||||
print "Adding dist_to_shed column to the tool_shed_repository table failed: %s" % str( e )
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ def downgrade(migrate_engine):
|
||||
ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True )
|
||||
try:
|
||||
ToolShedRepository_table.c.uninstalled.drop()
|
||||
except Exception, e:
|
||||
except Exception as 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:
|
||||
except Exception as e:
|
||||
print "Dropping column dist_to_shed from the tool_shed_repository table failed: %s" % str( e )
|
||||
|
||||
@@ -63,11 +63,11 @@ def upgrade(migrate_engine):
|
||||
# Create the tables.
|
||||
try:
|
||||
ToolVersion_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating tool_version table failed: %s" % str( e ) )
|
||||
try:
|
||||
ToolVersionAssociation_table.create()
|
||||
except Exception, e:
|
||||
except Exception as 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"
|
||||
@@ -89,7 +89,7 @@ def upgrade(migrate_engine):
|
||||
# Drop the tool_id_guid_map table since the 2 new tables render it unnecessary.
|
||||
try:
|
||||
ToolIdGuidMap_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_id_guid_map table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -110,13 +110,13 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolVersionAssociation_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_version_association table failed: %s" % str( e ) )
|
||||
try:
|
||||
ToolVersion_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_version table failed: %s" % str( e ) )
|
||||
try:
|
||||
ToolIdGuidMap_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating tool_id_guid_map table failed: %s" % str( e ) )
|
||||
|
||||
@@ -37,7 +37,7 @@ def upgrade(migrate_engine):
|
||||
MigrateTools_table.create()
|
||||
cmd = "INSERT INTO migrate_tools VALUES ('GalaxyTools', 'lib/galaxy/tool_shed/migrate', %d)" % 1
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating migrate_tools table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -46,5 +46,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
MigrateTools_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping migrate_tools table failed: %s" % str( e ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
params_col.create( Job_table, index_name="ix_job_params")
|
||||
assert params_col is Job_table.c.params
|
||||
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding column 'params' to job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -45,5 +45,5 @@ def downgrade(migrate_engine):
|
||||
Job_table = Table( "job", metadata, autoload=True )
|
||||
params_col = Job_table.c.params
|
||||
params_col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'params' from job table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
handler_col.create( Job_table, index_name="ix_job_handler" )
|
||||
assert handler_col is Job_table.c.handler
|
||||
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding column 'handler' to job table failed: %s" % str( e ) )
|
||||
|
||||
@@ -45,5 +45,5 @@ def downgrade(migrate_engine):
|
||||
Job_table = Table( "job", metadata, autoload=True )
|
||||
handler_col = Job_table.c.handler
|
||||
handler_col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'handler' from job table failed: %s" % ( str( e ) ) )
|
||||
|
||||
@@ -25,7 +25,7 @@ def upgrade(migrate_engine):
|
||||
# Create history_dataset_association_subset.
|
||||
try:
|
||||
HistoryDatasetAssociationSubset_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Creating history_dataset_association_subset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -35,7 +35,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i1.create()
|
||||
i2.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Adding indices to table 'history_dataset_association_subset' table failed: %s" % str( e ) )
|
||||
|
||||
@@ -47,6 +47,6 @@ def downgrade(migrate_engine):
|
||||
# Drop history_dataset_association_subset table.
|
||||
try:
|
||||
HistoryDatasetAssociationSubset_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
log.debug( "Dropping history_dataset_association_subset table failed: %s" % str( e ) )
|
||||
|
||||
@@ -23,14 +23,14 @@ def upgrade(migrate_engine):
|
||||
c = Column( "provider", TrimmedString( 255 ) )
|
||||
c.create( OpenID_table )
|
||||
assert c is OpenID_table.c.provider
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding provider column to galaxy_user_openid table failed: %s" % str( e )
|
||||
log.debug( "Adding provider column to galaxy_user_openid table failed: %s" % str( e ) )
|
||||
|
||||
try:
|
||||
cmd = "DELETE FROM galaxy_user_openid WHERE openid='%s'" % ( BAD_IDENTIFIER )
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Deleting bad Identifiers from galaxy_user_openid failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -40,6 +40,6 @@ def downgrade(migrate_engine):
|
||||
try:
|
||||
OpenID_table = Table( "galaxy_user_openid", metadata, autoload=True )
|
||||
OpenID_table.c.provider.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping provider column from galaxy_user_openid table failed: %s" % str( e )
|
||||
log.debug( "Dropping provider column from galaxy_user_openid table failed: %s" % str( e ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
col.create( ToolShedRepository_table )
|
||||
assert col is ToolShedRepository_table.c.ctx_rev
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Adding ctx_rev column to the tool_shed_repository table failed: %s" % str( e )
|
||||
|
||||
|
||||
@@ -41,5 +41,5 @@ def downgrade(migrate_engine):
|
||||
ToolShedRepository_table = Table( "tool_shed_repository", metadata, autoload=True )
|
||||
try:
|
||||
ToolShedRepository_table.c.ctx_rev.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print "Dropping column ctx_rev from the tool_shed_repository table failed: %s" % str( e )
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
GenomeIndexToolData_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating genome_index_tool_data table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -48,5 +48,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
GenomeIndexToolData_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping genome_index_tool_data table failed: %s" % str( e ) )
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolDependency_table.create()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Creating tool_dependency table failed: %s" % str( e ) )
|
||||
|
||||
|
||||
@@ -48,5 +48,5 @@ def downgrade(migrate_engine):
|
||||
metadata.reflect()
|
||||
try:
|
||||
ToolDependency_table.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping tool_dependency table failed: %s" % str( e ) )
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ def upgrade(migrate_engine):
|
||||
if cmd:
|
||||
try:
|
||||
migrate_engine.execute( cmd )
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Altering tool_dependency.version column from TrimmedString(40) to Text failed: %s" % str( e ) )
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
col = ToolDependency_table.c.installed_changeset_revision
|
||||
col.drop()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
log.debug( "Dropping column 'installed_changeset_revision' from tool_dependency table failed: %s" % ( str( e ) ) )
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user