feat: relation revendeur sur Customer/Website + WebsiteConfiguration
Customer : - Ajout revendeurCode (VARCHAR 10, nullable) : stocke le code du revendeur apporteur d'affaire (pas de FK, suppression revendeur sans impact) - Select revendeur dans le formulaire de création client - Champ revendeur dans la fiche client (info + section système) Website : - Ajout revendeurCode (VARCHAR 10, nullable) : même logique que Customer WebsiteConfiguration (nouvelle entité) : - website (ManyToOne CASCADE) : site parent - type (VARCHAR 25) : clé de configuration - value (TEXT) : valeur - Contrainte unique (website_id, type) Formulaire création client : - Select "Revendeur (apporteur d'affaire)" avec liste des revendeurs actifs Fiche client : - Onglet Info : champ code revendeur éditable - Section système : affiche le code revendeur Migrations : ALTER TABLE customer/website ADD revendeur_code, CREATE TABLE website_configuration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
migrations/Version20260404193257.php
Normal file
31
migrations/Version20260404193257.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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 Version20260404193257 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('ALTER TABLE customer ADD revendeur_code VARCHAR(10) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE customer DROP revendeur_code');
|
||||
}
|
||||
}
|
||||
37
migrations/Version20260404193605.php
Normal file
37
migrations/Version20260404193605.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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 Version20260404193605 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 website_configuration (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, type VARCHAR(25) NOT NULL, value TEXT NOT NULL, website_id INT NOT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_8BC287E818F45C82 ON website_configuration (website_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_8BC287E818F45C828CDE5729 ON website_configuration (website_id, type)');
|
||||
$this->addSql('ALTER TABLE website_configuration ADD CONSTRAINT FK_8BC287E818F45C82 FOREIGN KEY (website_id) REFERENCES website (id) ON DELETE CASCADE NOT DEFERRABLE');
|
||||
$this->addSql('ALTER TABLE website ADD revendeur_code VARCHAR(10) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE website_configuration DROP CONSTRAINT FK_8BC287E818F45C82');
|
||||
$this->addSql('DROP TABLE website_configuration');
|
||||
$this->addSql('ALTER TABLE website DROP revendeur_code');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user