migrations/Version20230105101034.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20230105101034 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'put the max price in the min price for sell type property';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql("UPDATE property
  15.                                 SET minimal_price = p.maximum_price
  16.                                 FROM property p
  17.                                 INNER JOIN reference_property_service_type rpst on p.reference_service_type_id = rpst.id
  18.                                 WHERE rpst.code = '2'
  19.                                 AND property.id = p.id"
  20.         );
  21.     }
  22. }