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.0085_add_task_info

"""
Migration script to add 'info' column to the task table.
"""
from __future__ import print_function

import logging

from sqlalchemy import Column, MetaData, Table

from galaxy.model.custom_types import TrimmedString

log = logging.getLogger(__name__)
metadata = MetaData()


[docs]def upgrade(migrate_engine): metadata.bind = migrate_engine print(__doc__) metadata.reflect() try: task_table = Table("task", metadata, autoload=True) c = Column("info", TrimmedString(255), nullable=True) c.create(task_table) assert c is task_table.c.info except Exception: log.exception("Adding info column to task table failed.")
[docs]def downgrade(migrate_engine): metadata.bind = migrate_engine metadata.reflect() try: task_table = Table("task", metadata, autoload=True) task_table.c.info.drop() except Exception: log.exception("Dropping info column from task table failed.")