<?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 Version20190823093150 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('ALTER TABLE newland_toubiz_sync_neos_domain_model_citydata CHANGE news news LONGTEXT DEFAULT NULL');
        $this->addSql('ALTER TABLE newland_toubiz_sync_neos_domain_model_event CHANGE client client VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE newland_toubiz_sync_neos_domain_model_article ADD processedname VARCHAR(255) NOT NULL');
    }

    /**
     * @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 parentpath ON neos_contentrepository_domain_model_nodedata');
        $this->addSql('CREATE INDEX parentpath ON neos_contentrepository_domain_model_nodedata (parentpath(255))');
        $this->addSql('DROP INDEX idx_35dc14f03332102a ON neos_flow_resourcemanagement_persistentresource');
        $this->addSql('CREATE INDEX IDX_6954B1F63332102A ON neos_flow_resourcemanagement_persistentresource (sha1)');
        $this->addSql('DROP INDEX fulltext_content ON newland_toubiz_search_neos_domain_model_searchindex');
        $this->addSql('ALTER TABLE newland_toubiz_sync_neos_domain_model_article DROP processedname');
        $this->addSql('ALTER TABLE newland_toubiz_sync_neos_domain_model_citydata CHANGE news news VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE newland_toubiz_sync_neos_domain_model_event CHANGE client client VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci');
    }
}
