root/galaxy-central/lib/galaxy/model/migrate/versions/0002_metadata_file_table.py

リビジョン 2, 0.9 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1from sqlalchemy import *
2from migrate import *
3
4import datetime
5now = datetime.datetime.utcnow
6
7# Need our custom types, but don't import anything else from model
8from galaxy.model.custom_types import *
9
10import logging
11log = logging.getLogger( __name__ )
12
13metadata = MetaData( migrate_engine )
14
15# New table in changeset 1568:0b022adfdc34
16MetadataFile_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
25def upgrade():
26    metadata.reflect()
27    MetadataFile_table.create()
28
29def downgrade():
30    metadata.reflect()
31    MetadataFile_table.drop()
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。