<?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 Version20231024173459 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 collaborator DROP INDEX UNIQ_606D487C30098C8C, ADD INDEX IDX_606D487C30098C8C (collaborator_id)');
$this->addSql('ALTER TABLE collaborator DROP FOREIGN KEY FK_606D487CA76ED395');
$this->addSql('DROP INDEX IDX_606D487CA76ED395 ON collaborator');
$this->addSql('ALTER TABLE collaborator ADD can_signe TINYINT(1) NOT NULL, ADD allowed_to_signe TINYINT(1) NOT NULL, CHANGE user_id client_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE collaborator ADD CONSTRAINT FK_606D487C19EB6921 FOREIGN KEY (client_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_606D487C19EB6921 ON collaborator (client_id)');
$this->addSql('ALTER TABLE user DROP can_signe');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collaborator DROP INDEX IDX_606D487C30098C8C, ADD UNIQUE INDEX UNIQ_606D487C30098C8C (collaborator_id)');
$this->addSql('ALTER TABLE collaborator DROP FOREIGN KEY FK_606D487C19EB6921');
$this->addSql('DROP INDEX IDX_606D487C19EB6921 ON collaborator');
$this->addSql('ALTER TABLE collaborator DROP can_signe, DROP allowed_to_signe, CHANGE client_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE collaborator ADD CONSTRAINT FK_606D487CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_606D487CA76ED395 ON collaborator (user_id)');
$this->addSql('ALTER TABLE user ADD can_signe TINYINT(1) NOT NULL');
}
}