migrations/Version20181121145247.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Removing NOT NULL on users on collumn users_id because registration was not working
  7.  */
  8. class Version20181121145247 extends AbstractMigration
  9. {
  10.     /**
  11.      * @param Schema $schema
  12.      */
  13.     public function up(Schema $schema) : void
  14.     {
  15.         // this up() migration is auto-generated, please modify it to your needs
  16.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  17.         $this->addSql('ALTER TABLE users ALTER users_id DROP DEFAULT');
  18.         $this->addSql('ALTER TABLE users ALTER users_id DROP NOT NULL');
  19.     }
  20.     /**
  21.      * @param Schema $schema
  22.      */
  23.     public function down(Schema $schema) : void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  27.         //$this->addSql('CREATE SCHEMA public');
  28.         $this->addSql('ALTER TABLE users ALTER users_id SET DEFAULT 1');
  29.         $this->addSql('ALTER TABLE users ALTER users_id SET NOT NULL');
  30.     }
  31. }