<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230130135743 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create business request table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE business_request (id UUID NOT NULL, agent_id INT NOT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, rooms_number INT DEFAULT NULL, bedrooms_number INT DEFAULT NULL, area DOUBLE PRECISION NOT NULL, max_area DOUBLE PRECISION DEFAULT NULL, price DOUBLE PRECISION NOT NULL, max_price DOUBLE PRECISION DEFAULT NULL, neighborhood VARCHAR(255) DEFAULT NULL, city INT NOT NULL, other_informations VARCHAR(255) DEFAULT NULL, service_type VARCHAR(255) DEFAULT NULL, property_type VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_66A434D23414710B ON business_request (agent_id)');
$this->addSql('COMMENT ON COLUMN business_request.id IS \'(DC2Type:ulid)\'');
$this->addSql('ALTER TABLE business_request ADD CONSTRAINT FK_66A434D23414710B FOREIGN KEY (agent_id) REFERENCES agent (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE business_request');
}
}