<?php declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20190108143727 extends AbstractMigration
{
    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, 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 news CHANGE fichier_id fichier_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
        $this->addSql('ALTER TABLE user CHANGE adherent_id adherent_id INT DEFAULT NULL, CHANGE prestataire_id prestataire_id INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
        $this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE prestataire ADD horaires VARCHAR(255) DEFAULT NULL, CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
        $this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
        $this->addSql('ALTER TABLE groupeprestaire DROP FOREIGN KEY FK_FB9ABBCEEF390162');
        $this->addSql('DROP INDEX UNIQ_FB9ABBCEEF390162 ON groupeprestaire');
        $this->addSql('ALTER TABLE groupeprestaire DROP geoloc_id, DROP type, DROP horaires, DROP tel, DROP email');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, 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 charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
        $this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 8) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 8) DEFAULT \'NULL\'');
        $this->addSql('ALTER TABLE groupeprestaire ADD geoloc_id INT DEFAULT NULL, ADD type VARCHAR(20) NOT NULL COLLATE utf8mb4_unicode_ci, ADD horaires VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, ADD tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, ADD email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE groupeprestaire ADD CONSTRAINT FK_FB9ABBCEEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_FB9ABBCEEF390162 ON groupeprestaire (geoloc_id)');
        $this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE prestataire DROP horaires, CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
        $this->addSql('ALTER TABLE user CHANGE adherent_id adherent_id INT DEFAULT NULL, CHANGE prestataire_id prestataire_id INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
    }
}
