Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
Source code for galaxy.model.migrate.versions.0072_add_pid_and_socket_columns_to_transfer_job_table
"""
Migration script to add 'pid' and 'socket' columns to the transfer_job table.
"""
from __future__ import print_function
import logging
from sqlalchemy import Column, Integer, MetaData, Table
log = logging.getLogger(__name__)
metadata = MetaData()
[docs]def upgrade(migrate_engine):
metadata.bind = migrate_engine
print(__doc__)
metadata.reflect()
try:
TransferJob_table = Table("transfer_job", metadata, autoload=True)
c = Column("pid", Integer)
c.create(TransferJob_table)
assert c is TransferJob_table.c.pid
c = Column("socket", Integer)
c.create(TransferJob_table)
assert c is TransferJob_table.c.socket
except Exception:
log.exception("Adding columns to transfer_job table failed.")
[docs]def downgrade(migrate_engine):
metadata.bind = migrate_engine
metadata.reflect()
try:
TransferJob_table = Table("transfer_job", metadata, autoload=True)
TransferJob_table.c.pid.drop()
TransferJob_table.c.socket.drop()
except Exception:
log.exception("Dropping columns from transfer_job table failed.")