Neos.ContentRepository/Migrations/Postgresql/Version20131203110242.php
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']));
            }
        }
    }
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']));
            }
        }
    }
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' ] ) ) ; } } }
Generate UUIDs in PHP if the uuid-ossp extension is not installed.

@param Schema $schema
@return void
Generate UUIDs in PHP if the uuid - ossp extension is not installed .