"""
This script adds tables needed for Galaxy cloud functionality.
"""
from __future__ import print_function

import datetime
import logging

from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT

now = datetime.datetime.utcnow
log = logging.getLogger( __name__ )
metadata = MetaData()

CloudImage_table = Table( "cloud_image", metadata,
                          Column( "id", Integer, primary_key=True ),
                          Column( "create_time", DateTime, default=now ),
                          Column( "update_time", DateTime, default=now, onupdate=now ),
                          Column( "provider_type", TEXT ),
                          Column( "image_id", TEXT, nullable=False ),
                          Column( "manifest", TEXT ),
                          Column( "state", TEXT ),
                          Column( "architecture", TEXT ),
                          Column( "deleted", Boolean, default=False ) )

""" UserConfiguredInstance (UCI) table """
UCI_table = Table( "cloud_uci", metadata,
                   Column( "id", Integer, primary_key=True ),
                   Column( "create_time", DateTime, default=now ),
                   Column( "update_time", DateTime, default=now, onupdate=now ),
                   Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                   Column( "credentials_id", Integer, ForeignKey( "cloud_user_credentials.id" ), index=True ),
                   Column( "key_pair_name", TEXT ),
                   Column( "key_pair_material", TEXT ),
                   Column( "name", TEXT ),
                   Column( "state", TEXT ),
                   Column( "error", TEXT ),
                   Column( "total_size", Integer ),
                   Column( "launch_time", DateTime ),
                   Column( "deleted", Boolean, default=False ) )

CloudInstance_table = Table( "cloud_instance", metadata,
                             Column( "id", Integer, primary_key=True ),
                             Column( "create_time", DateTime, default=now ),
                             Column( "update_time", DateTime, default=now, onupdate=now ),
                             Column( "launch_time", DateTime ),
                             Column( "stop_time", DateTime ),
                             Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                             Column( "uci_id", Integer, ForeignKey( "cloud_uci.id" ), index=True ),
                             Column( "type", TEXT ),
                             Column( "reservation_id", TEXT ),
                             Column( "instance_id", TEXT ),
                             Column( "mi_id", Integer, ForeignKey( "cloud_image.id" ), index=True ),
                             Column( "state", TEXT ),
                             Column( "error", TEXT ),
                             Column( "public_dns", TEXT ),
                             Column( "private_dns", TEXT ),
                             Column( "security_group", TEXT ),
                             Column( "availability_zone", TEXT ) )

CloudStore_table = Table( "cloud_store", metadata,
                          Column( "id", Integer, primary_key=True ),
                          Column( "create_time", DateTime, default=now ),
                          Column( "update_time", DateTime, default=now, onupdate=now ),
                          Column( "attach_time", DateTime ),
                          Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                          Column( "uci_id", Integer, ForeignKey( "cloud_uci.id" ), index=True, nullable=False ),
                          Column( "volume_id", TEXT ),
                          Column( "size", Integer, nullable=False ),
                          Column( "availability_zone", TEXT ),
                          Column( "inst_id", Integer, ForeignKey( "cloud_instance.id" ) ),
                          Column( "status", TEXT ),
                          Column( "device", TEXT ),
                          Column( "space_consumed", Integer ),
                          Column( "error", TEXT ),
                          Column( "deleted", Boolean, default=False ) )

CloudSnapshot_table = Table( "cloud_snapshot", metadata,
                             Column( "id", Integer, primary_key=True ),
                             Column( "create_time", DateTime, default=now ),
                             Column( "update_time", DateTime, default=now, onupdate=now ),
                             Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                             Column( "uci_id", Integer, ForeignKey( "cloud_uci.id" ), index=True ),
                             Column( "store_id", Integer, ForeignKey( "cloud_store.id" ), index=True, nullable=False ),
                             Column( "snapshot_id", TEXT ),
                             Column( "status", TEXT ),
                             Column( "description", TEXT ),
                             Column( "error", TEXT ),
                             Column( "deleted", Boolean, default=False ) )

CloudUserCredentials_table = Table( "cloud_user_credentials", metadata,
                                    Column( "id", Integer, primary_key=True ),
                                    Column( "create_time", DateTime, default=now ),
                                    Column( "update_time", DateTime, default=now, onupdate=now ),
                                    Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                                    Column( "provider_id", Integer, ForeignKey( "cloud_provider.id" ), index=True, nullable=False ),
                                    Column( "name", TEXT ),
                                    Column( "access_key", TEXT ),
                                    Column( "secret_key", TEXT ),
                                    Column( "deleted", Boolean, default=False ) )

CloudProvider_table = Table( "cloud_provider", metadata,
                             Column( "id", Integer, primary_key=True ),
                             Column( "create_time", DateTime, default=now ),
                             Column( "update_time", DateTime, default=now, onupdate=now ),
                             Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True, nullable=False ),
                             Column( "type", TEXT, nullable=False ),
                             Column( "name", TEXT ),
                             Column( "region_connection", TEXT ),
                             Column( "region_name", TEXT ),
                             Column( "region_endpoint", TEXT ),
                             Column( "is_secure", Boolean ),
                             Column( "host", TEXT ),
                             Column( "port", Integer ),
                             Column( "proxy", TEXT ),
                             Column( "proxy_port", TEXT ),
                             Column( "proxy_user", TEXT ),
                             Column( "proxy_pass", TEXT ),
                             Column( "debug", Integer ),
                             Column( "https_connection_factory", TEXT ),
                             Column( "path", TEXT ),
                             Column( "deleted", Boolean, default=False ) )


def upgrade(migrate_engine):
    metadata.bind = migrate_engine
    print(__doc__)
    # Load existing tables
    metadata.reflect()
    try:
        CloudProvider_table.create()
        CloudUserCredentials_table.create()
        CloudImage_table.create()
        UCI_table.create()
        CloudInstance_table.create()
        CloudStore_table.create()
        CloudSnapshot_table.create()
    except Exception:
        log.exception("Creating cloud tables failed.")


def downgrade(migrate_engine):
    metadata.bind = migrate_engine
    metadata.reflect()
    try:
        CloudSnapshot_table.drop()
        CloudStore_table.drop()
        CloudInstance_table.drop()
        UCI_table.drop()
        CloudImage_table.drop()
        CloudUserCredentials_table.drop()
        CloudProvider_table.drop()
    except Exception:
        log.exception("Dropping cloud tables failed.")

[(12, 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), False, 'import logging\n'), (13, 'sqlalchemy.MetaData', 'MetaData', ([], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (16, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (17, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (18, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (19, 'sqlalchemy.Column', 'Column', (['"""provider_type"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (20, 'sqlalchemy.Column', 'Column', (['"""image_id"""', 'TEXT'], {'nullable': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (21, 'sqlalchemy.Column', 'Column', (['"""manifest"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (22, 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (23, 'sqlalchemy.Column', 'Column', (['"""architecture"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (24, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (28, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (29, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (30, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (33, 'sqlalchemy.Column', 'Column', (['"""key_pair_name"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (34, 'sqlalchemy.Column', 'Column', (['"""key_pair_material"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (35, 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (36, 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (37, 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (38, 'sqlalchemy.Column', 'Column', (['"""total_size"""', 'Integer'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (39, 'sqlalchemy.Column', 'Column', (['"""launch_time"""', 'DateTime'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (40, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (43, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (44, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (45, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (46, 'sqlalchemy.Column', 'Column', (['"""launch_time"""', 'DateTime'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (47, 'sqlalchemy.Column', 'Column', (['"""stop_time"""', 'DateTime'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (50, 'sqlalchemy.Column', 'Column', (['"""type"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (51, 'sqlalchemy.Column', 'Column', (['"""reservation_id"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (52, 'sqlalchemy.Column', 'Column', (['"""instance_id"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (54, 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (55, 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (56, 'sqlalchemy.Column', 'Column', (['"""public_dns"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (57, 'sqlalchemy.Column', 'Column', (['"""private_dns"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (58, 'sqlalchemy.Column', 'Column', (['"""security_group"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (59, 'sqlalchemy.Column', 'Column', (['"""availability_zone"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (62, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (63, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (64, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (65, 'sqlalchemy.Column', 'Column', (['"""attach_time"""', 'DateTime'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (68, 'sqlalchemy.Column', 'Column', (['"""volume_id"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (69, 'sqlalchemy.Column', 'Column', (['"""size"""', 'Integer'], {'nullable': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (70, 'sqlalchemy.Column', 'Column', (['"""availability_zone"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (72, 'sqlalchemy.Column', 'Column', (['"""status"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (73, 'sqlalchemy.Column', 'Column', (['"""device"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (74, 'sqlalchemy.Column', 'Column', (['"""space_consumed"""', 'Integer'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (75, 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (76, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (79, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (80, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (81, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (85, 'sqlalchemy.Column', 'Column', (['"""snapshot_id"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (86, 'sqlalchemy.Column', 'Column', (['"""status"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (87, 'sqlalchemy.Column', 'Column', (['"""description"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (88, 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (89, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (92, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (93, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (94, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (97, 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (98, 'sqlalchemy.Column', 'Column', (['"""access_key"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (99, 'sqlalchemy.Column', 'Column', (['"""secret_key"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (100, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (103, 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (104, 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (105, 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (107, 'sqlalchemy.Column', 'Column', (['"""type"""', 'TEXT'], {'nullable': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (108, 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (109, 'sqlalchemy.Column', 'Column', (['"""region_connection"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (110, 'sqlalchemy.Column', 'Column', (['"""region_name"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (111, 'sqlalchemy.Column', 'Column', (['"""region_endpoint"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (112, 'sqlalchemy.Column', 'Column', (['"""is_secure"""', 'Boolean'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (113, 'sqlalchemy.Column', 'Column', (['"""host"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (114, 'sqlalchemy.Column', 'Column', (['"""port"""', 'Integer'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (115, 'sqlalchemy.Column', 'Column', (['"""proxy"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (116, 'sqlalchemy.Column', 'Column', (['"""proxy_port"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (117, 'sqlalchemy.Column', 'Column', (['"""proxy_user"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (118, 'sqlalchemy.Column', 'Column', (['"""proxy_pass"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (119, 'sqlalchemy.Column', 'Column', (['"""debug"""', 'Integer'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (120, 'sqlalchemy.Column', 'Column', (['"""https_connection_factory"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (121, 'sqlalchemy.Column', 'Column', (['"""path"""', 'TEXT'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (122, 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (31, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (32, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_user_credentials.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (48, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (49, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (53, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_image.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (66, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (67, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (71, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_instance.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (82, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (83, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (84, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_store.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (95, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (96, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_provider.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), (106, 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n')]