migrations/Version20210414215130.php line 1

  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Auto-generated Migration: Please modify to your needs!
  7.  */
  8. class Version20210414215130 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 ADD PASSWORD_EXPIRE TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  18.         $this->addSql('ALTER TABLE users ADD PASSWORD_RESET_HASH VARCHAR(255) DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE users ADD PASSWORD_RESET_HASH_VALIDITY TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  20.         $this->addSql('COMMENT ON COLUMN users.PASSWORD_EXPIRE IS \'Password expire date\'');
  21.         $this->addSql('COMMENT ON COLUMN users.PASSWORD_RESET_HASH IS \'Hash needed to reset password\'');
  22.         $this->addSql('COMMENT ON COLUMN users.PASSWORD_RESET_HASH_VALIDITY IS \'Date until the password reset hash is valid\'');
  23.         $this->addSql('ALTER TABLE users ADD CREDENTIALS_SENT_LAST_ON TIMESTAMP(0)');
  24.         $this->addSql('ALTER TABLE users ADD SEND_CREDENTIALS_IMMEDIATELY BOOLEAN DEFAULT TRUE');
  25.         $this->addSql('COMMENT ON COLUMN users.CREDENTIALS_SENT_LAST_ON IS \'Last time sent user credentials\'');
  26.     }
  27.     /**
  28.      * @param Schema $schema
  29.      */
  30.     public function down(Schema $schema) : void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.     }
  34. }