Neos\Flow\Persistence\Doctrine\Migrations\Version20150224171107::down PHP Метод

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

public down ( Doctrine\DBAL\Schema\Schema $schema ) : void
$schema Doctrine\DBAL\Schema\Schema
Результат void
    public function down(Schema $schema)
    {
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
        $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP FOREIGN KEY FK_30AB3A75B684C08");
        $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event DROP PRIMARY KEY");
        $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ADD persistence_object_identifier VARCHAR(40) NOT NULL, CHANGE uid uid INT AUTO_INCREMENT NOT NULL, CHANGE parentevent parentevent VARCHAR(40) DEFAULT NULL");
        $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event SET persistence_object_identifier = UUID()");
        $this->addSql("UPDATE typo3_neos_eventlog_domain_model_event e, (SELECT DISTINCT uid, persistence_object_identifier FROM typo3_neos_eventlog_domain_model_event) p SET e.parentevent = p.persistence_object_identifier WHERE parentevent IS NOT NULL AND p.uid = e.parentevent");
        $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ADD PRIMARY KEY (persistence_object_identifier)");
        $this->addSql("ALTER TABLE typo3_neos_eventlog_domain_model_event ADD CONSTRAINT FK_30AB3A75B684C08 FOREIGN KEY (parentevent) REFERENCES typo3_neos_eventlog_domain_model_event (persistence_object_identifier)");
    }
Version20150224171107