private function checkAclTables()
    {
        $this->writeln('<info>Checking ACL tables</info>', OutputInterface::VERBOSITY_VERBOSE);
        $this->write(' - ACL tables - ', false, OutputInterface::VERBOSITY_VERY_VERBOSE);

        $schemaManager = $this->em->getConnection()->getSchemaManager();

        $dropTableSql = [];
        $tablesMapping = [
            'class_table_name'         => 'acl_classes',
            'entry_table_name'         => 'acl_entries',
            'oid_table_name'           => 'acl_object_identities',
            'oid_ancestors_table_name' => 'acl_object_identity_ancestors',
            'sid_table_name'           => 'acl_security_identities',
        ];

        foreach ($tablesMapping as $value) {
            if ($schemaManager->tablesExist(array($value)) === true) {
                $dropTableSql[] = 'DROP TABLE IF EXISTS `' . $value. '`;';
            }
        }

        if (count($dropTableSql) != count($tablesMapping)) {
            if (!empty($dropTableSql)) {
                $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
                $this->em->getConnection()->executeQuery(implode(' ', $dropTableSql));
                $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');
            }

            $schema = new Schema($tablesMapping);
            $platform = $this->em->getConnection()->getDatabasePlatform();

            foreach ($schema->toSql($platform) as $query) {
                $this->em->getConnection()->executeQuery($query);
            }

            $this->writeln('<info>created</info>', OutputInterface::VERBOSITY_VERY_VERBOSE);
        } else {
            $this->writeln('<info>OK</info>', OutputInterface::VERBOSITY_VERY_VERBOSE);
        }

        return $this;
    }