'Test adding table and columns for consistencygroups.'

def _check_025(self, engine, data):

    metadata = sqlalchemy.MetaData()
    volumes = self.get_table_ref(engine, 'volumes', metadata)
    self.assertIsInstance(volumes.c.consistencygroup_id.type, self.VARCHAR_TYPE)
    snapshots = self.get_table_ref(engine, 'snapshots', metadata)
    self.assertIsInstance(snapshots.c.cgsnapshot_id.type, self.VARCHAR_TYPE)
    self.assertTrue(engine.dialect.has_table(engine.connect(), 'consistencygroups'))
    consistencygroups = self.get_table_ref(engine, 'consistencygroups', metadata)
    self.assertIsInstance(consistencygroups.c.created_at.type, self.TIME_TYPE)
    self.assertIsInstance(consistencygroups.c.updated_at.type, self.TIME_TYPE)
    self.assertIsInstance(consistencygroups.c.deleted_at.type, self.TIME_TYPE)
    self.assertIsInstance(consistencygroups.c.deleted.type, self.BOOL_TYPE)
    self.assertIsInstance(consistencygroups.c.id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.user_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.project_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.host.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.availability_zone.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.name.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.description.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.volume_type_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(consistencygroups.c.status.type, self.VARCHAR_TYPE)
    self.assertTrue(engine.dialect.has_table(engine.connect(), 'cgsnapshots'))
    cgsnapshots = self.get_table_ref(engine, 'cgsnapshots', metadata)
    self.assertIsInstance(cgsnapshots.c.created_at.type, self.TIME_TYPE)
    self.assertIsInstance(cgsnapshots.c.updated_at.type, self.TIME_TYPE)
    self.assertIsInstance(cgsnapshots.c.deleted_at.type, self.TIME_TYPE)
    self.assertIsInstance(cgsnapshots.c.deleted.type, self.BOOL_TYPE)
    self.assertIsInstance(cgsnapshots.c.id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.user_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.project_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.consistencygroup_id.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.name.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.description.type, self.VARCHAR_TYPE)
    self.assertIsInstance(cgsnapshots.c.status.type, self.VARCHAR_TYPE)
    (fkey,) = volumes.c.consistencygroup_id.foreign_keys
    self.assertEqual(consistencygroups.c.id, fkey.column)
    self.assertEqual(1, len(volumes.foreign_keys))
    (fkey,) = snapshots.c.cgsnapshot_id.foreign_keys
    self.assertEqual(cgsnapshots.c.id, fkey.column)
    (fkey,) = snapshots.c.volume_id.foreign_keys
    self.assertEqual(volumes.c.id, fkey.column)
    self.assertEqual(2, len(snapshots.foreign_keys))
