Neos\Flow\Persistence\Doctrine\Migrations\Version20130522131642::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() != "postgresql");
        // adjust Image table
        $this->addSql("ALTER TABLE typo3_media_domain_model_image ADD resource VARCHAR(40) DEFAULT NULL");
        $this->addSql("ALTER TABLE typo3_media_domain_model_image ADD title VARCHAR(255) NOT NULL");
        $this->addSql("ALTER TABLE typo3_media_domain_model_image ADD CONSTRAINT fk_7fa2358dbc91f416 FOREIGN KEY (resource) REFERENCES typo3_flow_resource_resource (persistence_object_identifier) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("CREATE INDEX idx_7fa2358dbc91f416 ON typo3_media_domain_model_image (resource)");
        // populate Image table with existing data
        $this->addSql("UPDATE typo3_media_domain_model_image AS image SET resource = (SELECT resource FROM typo3_media_domain_model_asset AS asset WHERE image.persistence_object_identifier = asset.persistence_object_identifier), title = (SELECT title FROM typo3_media_domain_model_asset AS asset WHERE image.persistence_object_identifier = asset.persistence_object_identifier)");
        // drop tables for Document, Video, Audio, Asset
        $this->addSql("ALTER TABLE typo3_media_domain_model_audio DROP CONSTRAINT FK_A2E2074747A46B0A");
        $this->addSql("ALTER TABLE typo3_media_domain_model_document DROP CONSTRAINT FK_F089E2F547A46B0A");
        $this->addSql("ALTER TABLE typo3_media_domain_model_image DROP CONSTRAINT FK_7FA2358D47A46B0A");
        $this->addSql("ALTER TABLE typo3_media_domain_model_video DROP CONSTRAINT FK_C658EBFE47A46B0A");
        $this->addSql("DROP TABLE typo3_media_domain_model_asset");
        $this->addSql("DROP TABLE typo3_media_domain_model_audio");
        $this->addSql("DROP TABLE typo3_media_domain_model_document");
        $this->addSql("DROP TABLE typo3_media_domain_model_video");
    }
Version20130522131642