<?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 Version20231211201641 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE visitors (id INT AUTO_INCREMENT NOT NULL, tracker_id INT DEFAULT NULL, product_id INT DEFAULT NULL, ip VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) DEFAULT NULL, device_id VARCHAR(255) DEFAULT NULL, created_at DATETIME(6) DEFAULT NULL, device VARCHAR(255) DEFAULT NULL, INDEX IDX_7B74A43FFB5230B (tracker_id), INDEX IDX_7B74A43F4584665A (product_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE visitors ADD CONSTRAINT FK_7B74A43FFB5230B FOREIGN KEY (tracker_id) REFERENCES tracker (id)');
$this->addSql('ALTER TABLE visitors ADD CONSTRAINT FK_7B74A43F4584665A FOREIGN KEY (product_id) REFERENCES product (id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE visitors');
}
}