<?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 Version20240322114854 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 leads__leads (id INT AUTO_INCREMENT NOT NULL, customer_id INT DEFAULT NULL, user_id INT DEFAULT NULL, mango_call_id INT DEFAULT NULL, created_at DATETIME NOT NULL, canceled_at DATETIME DEFAULT NULL, transmission_time DATETIME DEFAULT NULL, phone VARCHAR(12) NOT NULL, customer_first_name VARCHAR(255) NOT NULL, car_brand VARCHAR(255) DEFAULT NULL, car_model VARCHAR(255) DEFAULT NULL, car_vin VARCHAR(255) DEFAULT NULL, comment LONGTEXT DEFAULT NULL, confirmed TINYINT(1) DEFAULT 1 NOT NULL, INDEX IDX_938C653A9395C3F3 (customer_id), INDEX IDX_938C653AA76ED395 (user_id), UNIQUE INDEX UNIQ_938C653A6DD95BF (mango_call_id), INDEX IDX_938C653A444F97DD (phone), INDEX IDX_938C653A2B28B6 (transmission_time), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE leads__leads ADD CONSTRAINT FK_938C653A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customers__customers (id)');
$this->addSql('ALTER TABLE leads__leads ADD CONSTRAINT FK_938C653AA76ED395 FOREIGN KEY (user_id) REFERENCES users__users (id)');
$this->addSql('ALTER TABLE leads__leads ADD CONSTRAINT FK_938C653A6DD95BF FOREIGN KEY (mango_call_id) REFERENCES mango__calls (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE leads__leads DROP FOREIGN KEY FK_938C653A9395C3F3');
$this->addSql('ALTER TABLE leads__leads DROP FOREIGN KEY FK_938C653AA76ED395');
$this->addSql('ALTER TABLE leads__leads DROP FOREIGN KEY FK_938C653A6DD95BF');
$this->addSql('DROP TABLE leads__leads');
}
}