<?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 Version20250814083403 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 client (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, proginov_id VARCHAR(255) DEFAULT NULL, adresse VARCHAR(255) DEFAULT NULL, is_active TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_C7440455E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE projet (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, config JSON NOT NULL, details JSON DEFAULT NULL, last_processed_price NUMERIC(10, 2) DEFAULT NULL, uid VARCHAR(255) NOT NULL, status VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_50159CA9539B0606 (uid), INDEX IDX_50159CA99395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE projet ADD CONSTRAINT FK_50159CA99395C3F3 FOREIGN KEY (customer_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE slider CHANGE published_at published_at DATETIME NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE projet DROP FOREIGN KEY FK_50159CA99395C3F3');
$this->addSql('DROP TABLE client');
$this->addSql('DROP TABLE projet');
$this->addSql('ALTER TABLE slider CHANGE published_at published_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
}
}