<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20231011100814 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE legal_person (id INT AUTO_INCREMENT NOT NULL, person_id INT NOT NULL, name VARCHAR(100) DEFAULT NULL, company VARCHAR(100) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, email VARCHAR(200) DEFAULT NULL, address_number VARCHAR(15) DEFAULT NULL, address_street VARCHAR(100) DEFAULT NULL, address_street_type VARCHAR(15) DEFAULT NULL, address_postal_code VARCHAR(5) DEFAULT NULL, address_city VARCHAR(100) DEFAULT NULL, address_additional VARCHAR(255) DEFAULT NULL, address_latitude DOUBLE PRECISION DEFAULT NULL, address_longitude DOUBLE PRECISION DEFAULT NULL, INDEX IDX_D8EA0B0D217BBB47 (person_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE legal_person ADD CONSTRAINT FK_D8EA0B0D217BBB47 FOREIGN KEY (person_id) REFERENCES person (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE legal_person DROP FOREIGN KEY FK_D8EA0B0D217BBB47');
$this->addSql('DROP TABLE legal_person');
}
}