1 | from sqlalchemy import * |
---|
2 | from migrate import * |
---|
3 | |
---|
4 | import datetime |
---|
5 | now = datetime.datetime.utcnow |
---|
6 | |
---|
7 | # Need our custom types, but don't import anything else from model |
---|
8 | from galaxy.model.custom_types import * |
---|
9 | |
---|
10 | import logging |
---|
11 | log = logging.getLogger( __name__ ) |
---|
12 | |
---|
13 | metadata = MetaData( migrate_engine ) |
---|
14 | |
---|
15 | # New table in changeset 1568:0b022adfdc34 |
---|
16 | MetadataFile_table = Table( "metadata_file", metadata, |
---|
17 | Column( "id", Integer, primary_key=True ), |
---|
18 | Column( "name", TEXT ), |
---|
19 | Column( "hda_id", Integer, ForeignKey( "history_dataset_association.id" ), index=True, nullable=True ), |
---|
20 | Column( "create_time", DateTime, default=now ), |
---|
21 | Column( "update_time", DateTime, index=True, default=now, onupdate=now ), |
---|
22 | Column( "deleted", Boolean, index=True, default=False ), |
---|
23 | Column( "purged", Boolean, index=True, default=False ) ) |
---|
24 | |
---|
25 | def upgrade(): |
---|
26 | metadata.reflect() |
---|
27 | MetadataFile_table.create() |
---|
28 | |
---|
29 | def downgrade(): |
---|
30 | metadata.reflect() |
---|
31 | MetadataFile_table.drop() |
---|