<?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 Version20251112155725 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adiciona campos de sessão, fingerprint e localização à tabela std_ads_tracking';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
ALTER TABLE `std_ads_tracking`
ADD COLUMN `session_hash` VARCHAR(255) DEFAULT NULL AFTER `event_type`,
ADD COLUMN `tracking_id` VARCHAR(255) DEFAULT NULL AFTER `session_hash`,
ADD COLUMN `hashed_ip` VARCHAR(255) DEFAULT NULL AFTER `ip`,
ADD COLUMN `fingerprint` VARCHAR(255) DEFAULT NULL AFTER `hashed_ip`,
ADD COLUMN `country` VARCHAR(255) DEFAULT NULL AFTER `fingerprint`,
ADD COLUMN `city` VARCHAR(255) DEFAULT NULL AFTER `country`,
ADD COLUMN `precise_country` VARCHAR(255) DEFAULT NULL AFTER `city`,
ADD COLUMN `precise_city` VARCHAR(255) DEFAULT NULL AFTER `precise_country`;
SQL);
}
public function down(Schema $schema): void
{
$this->addSql(<<<'SQL'
ALTER TABLE `std_ads_tracking`
DROP COLUMN `session_hash`,
DROP COLUMN `tracking_id`,
DROP COLUMN `hashed_ip`,
DROP COLUMN `fingerprint`,
DROP COLUMN `country`,
DROP COLUMN `city`,
DROP COLUMN `precise_country`,
DROP COLUMN `precise_city`;
SQL);
}
}