<?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 Version20210923132819 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 proposed_game ALTER user_id TYPE INT');
$this->addSql('ALTER TABLE "user" ADD email VARCHAR(180) NOT NULL');
$this->addSql('ALTER TABLE "user" ADD roles JSON NOT NULL');
$this->addSql('ALTER TABLE "user" DROP name');
$this->addSql('ALTER TABLE "user" ALTER id TYPE INT');
$this->addSql('ALTER TABLE "user" ALTER password TYPE VARCHAR(255)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON "user" (email)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE proposed_game ALTER user_id DROP DEFAULT');
$this->addSql('ALTER TABLE "user" ADD name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" DROP email');
$this->addSql('ALTER TABLE "user" DROP roles');
$this->addSql('ALTER TABLE "user" ALTER id TYPE BIGINT');
$this->addSql('ALTER TABLE "user" ALTER password TYPE VARCHAR(128)');
$this->addSql('CREATE UNIQUE INDEX user_name_key ON "user" (name)');
}
}