"""
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.")

[((273, 300), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'import logging\n'), ((314, 324), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (322, 324), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((403, 442), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (409, 442), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((472, 516), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (478, 516), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((546, 604), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (552, 604), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((634, 663), 'sqlalchemy.Column', 'Column', (['"""provider_type"""', 'TEXT'], {}), "('provider_type', TEXT)\n", (640, 663), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((693, 733), 'sqlalchemy.Column', 'Column', (['"""image_id"""', 'TEXT'], {'nullable': '(False)'}), "('image_id', TEXT, nullable=False)\n", (699, 733), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((763, 787), 'sqlalchemy.Column', 'Column', (['"""manifest"""', 'TEXT'], {}), "('manifest', TEXT)\n", (769, 787), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((817, 838), 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), "('state', TEXT)\n", (823, 838), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((868, 896), 'sqlalchemy.Column', 'Column', (['"""architecture"""', 'TEXT'], {}), "('architecture', TEXT)\n", (874, 896), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((926, 967), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (932, 967), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1077, 1116), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (1083, 1116), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1139, 1183), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (1145, 1183), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1206, 1264), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (1212, 1264), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1507, 1536), 'sqlalchemy.Column', 'Column', (['"""key_pair_name"""', 'TEXT'], {}), "('key_pair_name', TEXT)\n", (1513, 1536), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1559, 1592), 'sqlalchemy.Column', 'Column', (['"""key_pair_material"""', 'TEXT'], {}), "('key_pair_material', TEXT)\n", (1565, 1592), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1615, 1635), 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), "('name', TEXT)\n", (1621, 1635), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1658, 1679), 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), "('state', TEXT)\n", (1664, 1679), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1702, 1723), 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), "('error', TEXT)\n", (1708, 1723), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1746, 1775), 'sqlalchemy.Column', 'Column', (['"""total_size"""', 'Integer'], {}), "('total_size', Integer)\n", (1752, 1775), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1798, 1829), 'sqlalchemy.Column', 'Column', (['"""launch_time"""', 'DateTime'], {}), "('launch_time', DateTime)\n", (1804, 1829), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1852, 1893), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (1858, 1893), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1985, 2024), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (1991, 2024), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2057, 2101), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (2063, 2101), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2134, 2192), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (2140, 2192), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2225, 2256), 'sqlalchemy.Column', 'Column', (['"""launch_time"""', 'DateTime'], {}), "('launch_time', DateTime)\n", (2231, 2256), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2289, 2318), 'sqlalchemy.Column', 'Column', (['"""stop_time"""', 'DateTime'], {}), "('stop_time', DateTime)\n", (2295, 2318), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2570, 2590), 'sqlalchemy.Column', 'Column', (['"""type"""', 'TEXT'], {}), "('type', TEXT)\n", (2576, 2590), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2623, 2653), 'sqlalchemy.Column', 'Column', (['"""reservation_id"""', 'TEXT'], {}), "('reservation_id', TEXT)\n", (2629, 2653), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2686, 2713), 'sqlalchemy.Column', 'Column', (['"""instance_id"""', 'TEXT'], {}), "('instance_id', TEXT)\n", (2692, 2713), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2847, 2868), 'sqlalchemy.Column', 'Column', (['"""state"""', 'TEXT'], {}), "('state', TEXT)\n", (2853, 2868), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2901, 2922), 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), "('error', TEXT)\n", (2907, 2922), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2955, 2981), 'sqlalchemy.Column', 'Column', (['"""public_dns"""', 'TEXT'], {}), "('public_dns', TEXT)\n", (2961, 2981), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3014, 3041), 'sqlalchemy.Column', 'Column', (['"""private_dns"""', 'TEXT'], {}), "('private_dns', TEXT)\n", (3020, 3041), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3074, 3104), 'sqlalchemy.Column', 'Column', (['"""security_group"""', 'TEXT'], {}), "('security_group', TEXT)\n", (3080, 3104), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3137, 3170), 'sqlalchemy.Column', 'Column', (['"""availability_zone"""', 'TEXT'], {}), "('availability_zone', TEXT)\n", (3143, 3170), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3253, 3292), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (3259, 3292), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3322, 3366), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (3328, 3366), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3396, 3454), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (3402, 3454), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3484, 3515), 'sqlalchemy.Column', 'Column', (['"""attach_time"""', 'DateTime'], {}), "('attach_time', DateTime)\n", (3490, 3515), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3774, 3799), 'sqlalchemy.Column', 'Column', (['"""volume_id"""', 'TEXT'], {}), "('volume_id', TEXT)\n", (3780, 3799), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3829, 3868), 'sqlalchemy.Column', 'Column', (['"""size"""', 'Integer'], {'nullable': '(False)'}), "('size', Integer, nullable=False)\n", (3835, 3868), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3898, 3931), 'sqlalchemy.Column', 'Column', (['"""availability_zone"""', 'TEXT'], {}), "('availability_zone', TEXT)\n", (3904, 3931), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4052, 4074), 'sqlalchemy.Column', 'Column', (['"""status"""', 'TEXT'], {}), "('status', TEXT)\n", (4058, 4074), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4104, 4126), 'sqlalchemy.Column', 'Column', (['"""device"""', 'TEXT'], {}), "('device', TEXT)\n", (4110, 4126), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4156, 4189), 'sqlalchemy.Column', 'Column', (['"""space_consumed"""', 'Integer'], {}), "('space_consumed', Integer)\n", (4162, 4189), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4219, 4240), 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), "('error', TEXT)\n", (4225, 4240), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4270, 4311), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (4276, 4311), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4403, 4442), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (4409, 4442), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4475, 4519), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (4481, 4519), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4552, 4610), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (4558, 4610), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4982, 5009), 'sqlalchemy.Column', 'Column', (['"""snapshot_id"""', 'TEXT'], {}), "('snapshot_id', TEXT)\n", (4988, 5009), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5042, 5064), 'sqlalchemy.Column', 'Column', (['"""status"""', 'TEXT'], {}), "('status', TEXT)\n", (5048, 5064), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5097, 5124), 'sqlalchemy.Column', 'Column', (['"""description"""', 'TEXT'], {}), "('description', TEXT)\n", (5103, 5124), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5157, 5178), 'sqlalchemy.Column', 'Column', (['"""error"""', 'TEXT'], {}), "('error', TEXT)\n", (5163, 5178), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5211, 5252), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (5217, 5252), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5366, 5405), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (5372, 5405), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5445, 5489), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (5451, 5489), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5529, 5587), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (5535, 5587), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5886, 5906), 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), "('name', TEXT)\n", (5892, 5906), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5946, 5972), 'sqlalchemy.Column', 'Column', (['"""access_key"""', 'TEXT'], {}), "('access_key', TEXT)\n", (5952, 5972), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6012, 6038), 'sqlalchemy.Column', 'Column', (['"""secret_key"""', 'TEXT'], {}), "('secret_key', TEXT)\n", (6018, 6038), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6078, 6119), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (6084, 6119), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6211, 6250), 'sqlalchemy.Column', 'Column', (['"""id"""', 'Integer'], {'primary_key': '(True)'}), "('id', Integer, primary_key=True)\n", (6217, 6250), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6283, 6327), 'sqlalchemy.Column', 'Column', (['"""create_time"""', 'DateTime'], {'default': 'now'}), "('create_time', DateTime, default=now)\n", (6289, 6327), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6360, 6418), 'sqlalchemy.Column', 'Column', (['"""update_time"""', 'DateTime'], {'default': 'now', 'onupdate': 'now'}), "('update_time', DateTime, default=now, onupdate=now)\n", (6366, 6418), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6570, 6606), 'sqlalchemy.Column', 'Column', (['"""type"""', 'TEXT'], {'nullable': '(False)'}), "('type', TEXT, nullable=False)\n", (6576, 6606), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6639, 6659), 'sqlalchemy.Column', 'Column', (['"""name"""', 'TEXT'], {}), "('name', TEXT)\n", (6645, 6659), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6692, 6725), 'sqlalchemy.Column', 'Column', (['"""region_connection"""', 'TEXT'], {}), "('region_connection', TEXT)\n", (6698, 6725), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6758, 6785), 'sqlalchemy.Column', 'Column', (['"""region_name"""', 'TEXT'], {}), "('region_name', TEXT)\n", (6764, 6785), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6818, 6849), 'sqlalchemy.Column', 'Column', (['"""region_endpoint"""', 'TEXT'], {}), "('region_endpoint', TEXT)\n", (6824, 6849), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6882, 6910), 'sqlalchemy.Column', 'Column', (['"""is_secure"""', 'Boolean'], {}), "('is_secure', Boolean)\n", (6888, 6910), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6943, 6963), 'sqlalchemy.Column', 'Column', (['"""host"""', 'TEXT'], {}), "('host', TEXT)\n", (6949, 6963), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6996, 7019), 'sqlalchemy.Column', 'Column', (['"""port"""', 'Integer'], {}), "('port', Integer)\n", (7002, 7019), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7052, 7073), 'sqlalchemy.Column', 'Column', (['"""proxy"""', 'TEXT'], {}), "('proxy', TEXT)\n", (7058, 7073), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7106, 7132), 'sqlalchemy.Column', 'Column', (['"""proxy_port"""', 'TEXT'], {}), "('proxy_port', TEXT)\n", (7112, 7132), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7165, 7191), 'sqlalchemy.Column', 'Column', (['"""proxy_user"""', 'TEXT'], {}), "('proxy_user', TEXT)\n", (7171, 7191), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7224, 7250), 'sqlalchemy.Column', 'Column', (['"""proxy_pass"""', 'TEXT'], {}), "('proxy_pass', TEXT)\n", (7230, 7250), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7283, 7307), 'sqlalchemy.Column', 'Column', (['"""debug"""', 'Integer'], {}), "('debug', Integer)\n", (7289, 7307), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7340, 7380), 'sqlalchemy.Column', 'Column', (['"""https_connection_factory"""', 'TEXT'], {}), "('https_connection_factory', TEXT)\n", (7346, 7380), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7413, 7433), 'sqlalchemy.Column', 'Column', (['"""path"""', 'TEXT'], {}), "('path', TEXT)\n", (7419, 7433), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((7466, 7507), 'sqlalchemy.Column', 'Column', (['"""deleted"""', 'Boolean'], {'default': '(False)'}), "('deleted', Boolean, default=False)\n", (7472, 7507), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1315, 1343), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (1325, 1343), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((1431, 1470), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_user_credentials.id"""'], {}), "('cloud_user_credentials.id')\n", (1441, 1470), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2379, 2407), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (2389, 2407), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2497, 2523), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), "('cloud_uci.id')\n", (2507, 2523), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((2772, 2800), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_image.id"""'], {}), "('cloud_image.id')\n", (2782, 2800), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3573, 3601), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (3583, 3601), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3688, 3714), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), "('cloud_uci.id')\n", (3698, 3714), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((3989, 4020), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_instance.id"""'], {}), "('cloud_instance.id')\n", (3999, 4020), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4671, 4699), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (4681, 4699), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4789, 4815), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_uci.id"""'], {}), "('cloud_uci.id')\n", (4799, 4815), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((4891, 4919), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_store.id"""'], {}), "('cloud_store.id')\n", (4901, 4919), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5655, 5683), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (5665, 5683), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((5785, 5816), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""cloud_provider.id"""'], {}), "('cloud_provider.id')\n", (5795, 5816), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n'), ((6479, 6507), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""galaxy_user.id"""'], {}), "('galaxy_user.id')\n", (6489, 6507), False, 'from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT\n')]