<?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 Version20220128083641 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('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user_event_checkins DROP FOREIGN KEY FK_B18E394C22397A3A');
$this->addSql('DROP INDEX IDX_B18E394C22397A3A ON user_event_checkins');
$this->addSql('ALTER TABLE user_event_checkins CHANGE event_user_id id_user_event INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_event_checkins ADD CONSTRAINT FK_B18E394C7CE67128 FOREIGN KEY (id_user_event) REFERENCES user_event (id)');
$this->addSql('CREATE INDEX IDX_B18E394C7CE67128 ON user_event_checkins (id_user_event)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE user');
$this->addSql('ALTER TABLE user_event_checkins DROP FOREIGN KEY FK_B18E394C7CE67128');
$this->addSql('DROP INDEX IDX_B18E394C7CE67128 ON user_event_checkins');
$this->addSql('ALTER TABLE user_event_checkins CHANGE id_user_event event_user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_event_checkins ADD CONSTRAINT FK_B18E394C22397A3A FOREIGN KEY (event_user_id) REFERENCES user_event (id)');
$this->addSql('CREATE INDEX IDX_B18E394C22397A3A ON user_event_checkins (event_user_id)');
}
}