migrations/Version20181121145247.php line 1
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Removing NOT NULL on users on collumn users_id because registration was not working
*/
class Version20181121145247 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE users ALTER users_id DROP DEFAULT');
$this->addSql('ALTER TABLE users ALTER users_id DROP NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
//$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE users ALTER users_id SET DEFAULT 1');
$this->addSql('ALTER TABLE users ALTER users_id SET NOT NULL');
}
}