<?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 Version20230509104739 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE address ADD address_file_name VARCHAR(255) DEFAULT NULL, ADD address_file_size INT DEFAULT NULL, ADD address_file_updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE child CHANGE birthDate birthDate DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE partner_pending CHANGE civility civility VARCHAR(6) NOT NULL, CHANGE firstname firstname VARCHAR(255) NOT NULL, CHANGE birthname birthname VARCHAR(255) NOT NULL, CHANGE phone_number phone_number VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL, CHANGE token token VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', CHANGE phoneNumber phoneNumber VARCHAR(255) DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
$this->addSql('ALTER TABLE vehicle ADD photos_cover_id VARCHAR(255) DEFAULT NULL, ADD has_photos_cover TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE address DROP address_file_name, DROP address_file_size, DROP address_file_updated_at');
$this->addSql('ALTER TABLE child CHANGE birthDate birthDate DATETIME NOT NULL');
$this->addSql('ALTER TABLE partner_pending CHANGE civility civility VARCHAR(6) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE firstname firstname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE birthname birthname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE phone_number phone_number VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE token token VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('DROP INDEX UNIQ_8D93D649E7927C74 ON user');
$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL, CHANGE phoneNumber phoneNumber VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE vehicle DROP photos_cover_id, DROP has_photos_cover');
}
}