def process_null_records(meta, scan=True):
 if scan:
  for table in reversed(meta.sorted_tables):
   if (table.name not in ('fixed_ips', 'shadow_fixed_ips')):
    scan_for_null_records(table, 'instance_uuid', check_fkeys=True)
 for table_name in ('instances', 'shadow_instances'):
  table = meta.tables[table_name]
  if scan:
   scan_for_null_records(table, 'uuid', check_fkeys=False)
  else:
   table.columns.uuid.alter(nullable=False)

def process_null_records ( meta , scan = True ) : if scan : for table in reversed ( meta . sorted_tables ) : if ( table . name not in ( 'fixed_ips' , 'shadow_fixed_ips' ) ) : scan_for_null_records ( table , 'instance_uuid' , check_fkeys = True ) for table_name in ( 'instances' , 'shadow_instances' ) : table = meta . tables [ table_name ] if scan : scan_for_null_records ( table , 'uuid' , check_fkeys = False ) else : table . columns . uuid . alter ( nullable = False )
scans the database for null instance_uuid records for processing .