<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230105101034 extends AbstractMigration
{
public function getDescription(): string
{
return 'put the max price in the min price for sell type property';
}
public function up(Schema $schema): void
{
$this->addSql("UPDATE property
SET minimal_price = p.maximum_price
FROM property p
INNER JOIN reference_property_service_type rpst on p.reference_service_type_id = rpst.id
WHERE rpst.code = '2'
AND property.id = p.id"
);
}
}