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

use Doctrine\DBAL\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 Version20170413191941 extends AbstractMigration
{

    /**
     * @return string
     */
    public function getDescription()
    {
        return 'FEATURE: Support profilepictures';
    }

    /**
     * @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 squadit_webapp_domain_model_user CHANGE profilepicture profilepicture VARCHAR(40) DEFAULT NULL');
        $this->addSql('ALTER TABLE squadit_webapp_domain_model_user ADD CONSTRAINT FK_7FD23F7D87C2CF6D FOREIGN KEY (profilepicture) REFERENCES typo3_flow_resource_resource (persistence_object_identifier)');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_7FD23F7D87C2CF6D ON squadit_webapp_domain_model_user (profilepicture)');
    }

    /**
     * @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('ALTER TABLE squadit_webapp_domain_model_user DROP FOREIGN KEY FK_7FD23F7D87C2CF6D');
        $this->addSql('DROP INDEX UNIQ_7FD23F7D87C2CF6D ON squadit_webapp_domain_model_user');
        $this->addSql('ALTER TABLE squadit_webapp_domain_model_user CHANGE profilepicture profilepicture VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci');
    }
}

Add mysql migration for profile pictures
TASK: Add mysql migration for profile pictures
