public function down(Schema $schema)
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
// adjust Image table
$this->addSql("ALTER TABLE typo3_media_domain_model_image DROP FOREIGN KEY FK_7FA2358D47A46B0A");
$this->addSql("ALTER TABLE typo3_media_domain_model_image ADD resource VARCHAR(40) DEFAULT NULL, ADD title VARCHAR(255) NOT NULL");
$this->addSql("ALTER TABLE typo3_media_domain_model_image ADD CONSTRAINT typo3_media_domain_model_image_ibfk_1 FOREIGN KEY (resource) REFERENCES typo3_flow_resource_resource (persistence_object_identifier)");
$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("DROP TABLE typo3_media_domain_model_document");
$this->addSql("DROP TABLE typo3_media_domain_model_video");
$this->addSql("DROP TABLE typo3_media_domain_model_audio");
$this->addSql("DROP TABLE typo3_media_domain_model_asset");
}