<s> from sqlalchemy import Boolean , Column , DateTime , ForeignKey <EOL> from sqlalchemy import Integer , MetaData , String , Table , Text <EOL> from nova import log as logging <EOL> meta = MetaData ( ) <EOL> instances = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> ) <EOL> services = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> ) <EOL> networks = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> ) <EOL> volumes = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> ) <EOL> certificates = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> ) <EOL> consoles = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , Integer ( ) ) , <EOL> Column ( '<STR_LIT:password>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT:port>' , Integer ( ) , nullable = True ) , <EOL> Column ( '<STR_LIT>' , <EOL> Integer ( ) , <EOL> ForeignKey ( '<STR_LIT>' ) ) , <EOL> ) <EOL> console_pools = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT:address>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT:username>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT:password>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT:host>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> ) <EOL> instance_actions = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT>' , <EOL> Integer ( ) , <EOL> ForeignKey ( '<STR_LIT>' ) ) , <EOL> Column ( '<STR_LIT:action>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT:error>' , <EOL> Text ( length = None , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> ) <EOL> iscsi_targets = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT>' , Integer ( ) ) , <EOL> Column ( '<STR_LIT:host>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> Integer ( ) , <EOL> ForeignKey ( '<STR_LIT>' ) , <EOL> nullable = True ) , <EOL> ) <EOL> auth_tokens = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( timezone = False ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( create_constraint = True , name = None ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) , <EOL> primary_key = True , <EOL> nullable = False ) , <EOL> Column ( '<STR_LIT>' , Integer ( ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> Column ( '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) , <EOL> ) <EOL> instances_availability_zone = Column ( <EOL> '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) <EOL> instances_locked = Column ( '<STR_LIT>' , <EOL> Boolean ( create_constraint = True , name = None ) ) <EOL> networks_cidr_v6 = Column ( <EOL> '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) <EOL> networks_ra_server = Column ( <EOL> '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) <EOL> services_availability_zone = Column ( <EOL> '<STR_LIT>' , <EOL> String ( length = <NUM_LIT:255> , convert_unicode = False , assert_unicode = None , <EOL> unicode_error = None , _warn_on_bytestring = False ) ) <EOL> def upgrade ( migrate_engine ) : <EOL> meta . bind = migrate_engine <EOL> tables = [ certificates , console_pools , consoles , instance_actions , <EOL> iscsi_targets ] <EOL> for table in tables : <EOL> try : <EOL> table . create ( ) <EOL> except Exception : <EOL> logging . info ( repr ( table ) ) <EOL> logging . exception ( '<STR_LIT>' ) <EOL> meta . drop_all ( tables = tables ) <EOL> raise <EOL> auth_tokens . c . user_id . alter ( type = String ( length = <NUM_LIT:255> , <EOL> convert_unicode = False , <EOL> assert_unicode = None , <EOL> unicode_error = None , <EOL> _warn_on_bytestring = False ) ) <EOL> instances . create_column ( instances_availability_zone ) <EOL> instances . create_column ( instances_locked ) <EOL> networks . create_column ( networks_cidr_v6 ) <EOL> networks . create_column ( networks_ra_server ) <EOL> services . create_column ( services_availability_zone ) </s>
