<?php
declare(strict_types=1);
namespace EckinoxSecurityMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210430172621 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 eckinox_user_groups (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE eckinox_users ADD user_group_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE eckinox_users ADD CONSTRAINT FK_70F7314A1ED93D47 FOREIGN KEY (user_group_id) REFERENCES eckinox_user_groups (id)');
$this->addSql('CREATE INDEX IDX_70F7314A1ED93D47 ON eckinox_users (user_group_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE eckinox_users DROP FOREIGN KEY FK_70F7314A1ED93D47');
$this->addSql('DROP TABLE eckinox_user_groups');
$this->addSql('DROP INDEX IDX_70F7314A1ED93D47 ON eckinox_users');
$this->addSql('ALTER TABLE eckinox_users DROP user_group_id');
}
}