<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used.
 */
class Version20190725085642 extends AbstractMigration
{

    /**
     * @return string
     */
    public function getDescription()
    {
        return '';
    }

    /**
     * @param Schema $schema
     * @return void
     */
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

        $this->addSql('CREATE INDEX newland_toubiz_domain_model_attribute_name_and_type ON newland_toubiz_sync_neos_domain_model_attribute (name, type)');
        $this->addSql('DROP INDEX identificationhash ON newland_toubiz_sync_neos_domain_model_attribute');
        $this->addSql('CREATE INDEX newland_toubiz_domain_model_attribute_identification_hash ON newland_toubiz_sync_neos_domain_model_attribute (identificationHash)');
    }

    /**
     * @param Schema $schema
     * @return void
     */
    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

        $this->addSql('DROP INDEX newland_toubiz_domain_model_attribute_name_and_type ON newland_toubiz_sync_neos_domain_model_attribute');
        $this->addSql('DROP INDEX newland_toubiz_domain_model_attribute_identification_hash ON newland_toubiz_sync_neos_domain_model_attribute');
        $this->addSql('CREATE INDEX identificationHash ON newland_toubiz_sync_neos_domain_model_attribute (identificationhash)');
    }
}
