diff --git a/Resources/migrations/Version201805181442210.php b/Resources/migrations/Version20180518144221.php similarity index 88% rename from Resources/migrations/Version201805181442210.php rename to Resources/migrations/Version20180518144221.php index 74d9c64c3..f1ac50961 100644 --- a/Resources/migrations/Version201805181442210.php +++ b/Resources/migrations/Version20180518144221.php @@ -12,7 +12,6 @@ final class Version20180518144221 extends AbstractMigration { 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 chill_person_person ADD contactInfo TEXT DEFAULT NULL'); @@ -22,7 +21,6 @@ final class Version20180518144221 extends AbstractMigration 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('ALTER TABLE chill_person_person DROP contactInfo'); diff --git a/Resources/migrations/Version20180820120000.php b/Resources/migrations/Version20180820120000.php new file mode 100644 index 000000000..04f132668 --- /dev/null +++ b/Resources/migrations/Version20180820120000.php @@ -0,0 +1,31 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('UPDATE chill_person_person SET contactInfo=email'); + $this->addSql('UPDATE chill_person_person SET email=\'\''); + + } + + public function down(Schema $schema) : void + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('UPDATE chill_person_person SET email=contactInfo'); + $this->addSql('UPDATE chill_person_person SET contactInfo=\'\''); + } +}