public function deleteFieldDefinitionsForType($typeId, $status)
    {
        $q = $this->dbHandler->createDeleteQuery();
        $q->deleteFrom(
            $this->dbHandler->quoteTable('ezcontentclass_attribute')
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                )
            )
        );

        $q->prepare()->execute();
        $subQuery = $this->connection->createQueryBuilder();
        $subQuery
            ->select('attr.id as ezcontentclass_attribute_id')
            ->from('ezcontentclass_attribute', 'attr')
            ->where('attr.contentclass_id = :typeId')
            ->andWhere('attr.id = ezcontentclass_attribute_ml.contentclass_attribute_id');

        $deleteQuery = $this->connection->createQueryBuilder();
        $deleteQuery
            ->delete('ezcontentclass_attribute_ml')
            ->where(
                sprintf('EXISTS (%s)', $subQuery->getSQL())
            )
            ->andWhere('ezcontentclass_attribute_ml.version = :status')
            ->setParameter('typeId', $typeId, ParameterType::INTEGER)
            ->setParameter('status', $status, ParameterType::INTEGER);

        $deleteQuery->execute();
    }