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.0079_input_library_to_job_table
"""
Migration script to add the job_to_input_library_dataset table.
"""
from __future__ import print_function
import logging
from sqlalchemy import Column, ForeignKey, Integer, MetaData, String, Table
log = logging.getLogger(__name__)
metadata = MetaData()
JobToInputLibraryDatasetAssociation_table = Table("job_to_input_library_dataset", metadata,
Column("id", Integer, primary_key=True),
Column("job_id", Integer, ForeignKey("job.id"), index=True),
Column("ldda_id", Integer, ForeignKey("library_dataset_dataset_association.id"), index=True),
Column("name", String(255)))
[docs]def upgrade(migrate_engine):
metadata.bind = migrate_engine
print(__doc__)
metadata.reflect()
# Create the job_to_input_library_dataset table
try:
JobToInputLibraryDatasetAssociation_table.create()
except Exception:
log.exception("Creating job_to_input_library_dataset table failed.")
[docs]def downgrade(migrate_engine):
metadata.bind = migrate_engine
metadata.reflect()
# Drop the job_to_input_library_dataset table
try:
JobToInputLibraryDatasetAssociation_table.drop()
except Exception:
log.exception("Dropping job_to_input_library_dataset table failed.")