Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of git://github.com/galaxyproject/galaxy into repo…
…_queue_sharing
- Loading branch information
Showing
9 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
lib/galaxy/model/migrate/versions/0133_add_dependency_column_to_job.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
""" | ||
Add dependencies column to jobs table | ||
""" | ||
from __future__ import print_function | ||
|
||
import logging | ||
|
||
from sqlalchemy import Column, MetaData, Table | ||
|
||
from galaxy.model.custom_types import JSONType | ||
|
||
log = logging.getLogger( __name__ ) | ||
jobs_dependencies_column = Column( "dependencies", JSONType, nullable=True ) | ||
|
||
|
||
def display_migration_details(): | ||
print("") | ||
print("This migration adds dependencies column to job table") | ||
|
||
|
||
def upgrade(migrate_engine): | ||
print(__doc__) | ||
metadata = MetaData() | ||
metadata.bind = migrate_engine | ||
metadata.reflect() | ||
|
||
# Add the dependencies column to the job table | ||
try: | ||
jobs_table = Table( "job", metadata, autoload=True ) | ||
jobs_dependencies_column.create( jobs_table ) | ||
assert jobs_dependencies_column is jobs_table.c.dependencies | ||
except Exception as e: | ||
print(str(e)) | ||
log.error( "Adding column 'dependencies' to job table failed: %s" % str( e ) ) | ||
return | ||
|
||
|
||
def downgrade(migrate_engine): | ||
metadata = MetaData() | ||
metadata.bind = migrate_engine | ||
metadata.reflect() | ||
|
||
# Drop the job table's dependencies column. | ||
try: | ||
jobs_table = Table( "job", metadata, autoload=True ) | ||
jobs_dependencies = jobs_table.c.dependencies | ||
jobs_dependencies.drop() | ||
except Exception as e: | ||
log.debug( "Dropping 'dependencies' column from job table failed: %s" % ( str( e ) ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters