Neos\Flow\Persistence\Doctrine\Migrations\Version20131203110242::preDown PHP Метод

preDown() публичный Метод

Generate UUIDs in PHP if the uuid-ossp extension is not installed.
public preDown ( Doctrine\DBAL\Schema\Schema $schema ) : void
$schema Doctrine\DBAL\Schema\Schema
Результат void
    public function preDown(Schema $schema)
    {
        $result = $this->connection->executeQuery("SELECT installed_version FROM pg_available_extensions WHERE name = 'uuid-ossp'");
        if ($result->fetchColumn() === null) {
            $this->connection->executeUpdate("ALTER TABLE typo3_typo3cr_domain_model_workspace ADD persistence_object_identifier VARCHAR(40)");
            $result = $this->connection->executeQuery('SELECT name FROM typo3_typo3cr_domain_model_workspace');
            foreach ($result->fetchAll() as $workspace) {
                $this->connection->update('typo3_typo3cr_domain_model_workspace', array('persistence_object_identifier' => \Neos\Flow\Utility\Algorithms::generateUUID()), array('name' => $workspace['name']));
            }
        }
    }
Version20131203110242