def _get_foreign_keys(t_images, t_image_members, t_image_properties, dialect):
 foreign_keys = []
 if t_image_members.foreign_keys:
  img_members_fk_name = list(t_image_members.foreign_keys)[0].name
  if (dialect == 'mysql'):
   fk1 = migrate.ForeignKeyConstraint([t_image_members.c.image_id], [t_images.c.id], name=img_members_fk_name)
  else:
   fk1 = migrate.ForeignKeyConstraint([t_image_members.c.image_id], [t_images.c.id])
  foreign_keys.append(fk1)
 if t_image_properties.foreign_keys:
  img_properties_fk_name = list(t_image_properties.foreign_keys)[0].name
  if (dialect == 'mysql'):
   fk2 = migrate.ForeignKeyConstraint([t_image_properties.c.image_id], [t_images.c.id], name=img_properties_fk_name)
  else:
   fk2 = migrate.ForeignKeyConstraint([t_image_properties.c.image_id], [t_images.c.id])
  foreign_keys.append(fk2)
 return foreign_keys

def _get_foreign_keys ( t_images , t_image_members , t_image_properties , dialect ) : foreign_keys = [ ] if t_image_members . foreign_keys : img_members_fk_name = list ( t_image_members . foreign_keys ) [ 0 ] . name if ( dialect == 'mysql' ) : fk1 = migrate . ForeignKeyConstraint ( [ t_image_members . c . image_id ] , [ t_images . c . id ] , name = img_members_fk_name ) else : fk1 = migrate . ForeignKeyConstraint ( [ t_image_members . c . image_id ] , [ t_images . c . id ] ) foreign_keys . append ( fk1 ) if t_image_properties . foreign_keys : img_properties_fk_name = list ( t_image_properties . foreign_keys ) [ 0 ] . name if ( dialect == 'mysql' ) : fk2 = migrate . ForeignKeyConstraint ( [ t_image_properties . c . image_id ] , [ t_images . c . id ] , name = img_properties_fk_name ) else : fk2 = migrate . ForeignKeyConstraint ( [ t_image_properties . c . image_id ] , [ t_images . c . id ] ) foreign_keys . append ( fk2 ) return foreign_keys
retrieve and return foreign keys for members/properties tables .