Files
e-cosplay/migrations/Version20251008124926.php
Serreau Jovann aff07c97e1 feat(Customer): Ajoute la gestion des échéances de paiement client
Ajoute l'entité CustomerSplit et les services associés pour gérer
les échéances de paiement des clients (PDF, envoi mail, etc.).
2025-10-09 09:18:01 +02:00

43 lines
2.2 KiB
PHP

<?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 Version20251008124926 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 customer_split (id SERIAL NOT NULL, customer_id INT DEFAULT NULL, create_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, num VARCHAR(255) NOT NULL, amount DOUBLE PRECISION NOT NULL, state VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_7FC0EF2A9395C3F3 ON customer_split (customer_id)');
$this->addSql('COMMENT ON COLUMN customer_split.create_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE TABLE customer_split_line (id SERIAL NOT NULL, split_id INT DEFAULT NULL, date_prev TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, amount DOUBLE PRECISION NOT NULL, state VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_B054515F3DDC68C5 ON customer_split_line (split_id)');
$this->addSql('COMMENT ON COLUMN customer_split_line.date_prev IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE customer_split ADD CONSTRAINT FK_7FC0EF2A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE customer_split_line ADD CONSTRAINT FK_B054515F3DDC68C5 FOREIGN KEY (split_id) REFERENCES customer_split (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE customer_split DROP CONSTRAINT FK_7FC0EF2A9395C3F3');
$this->addSql('ALTER TABLE customer_split_line DROP CONSTRAINT FK_B054515F3DDC68C5');
$this->addSql('DROP TABLE customer_split');
$this->addSql('DROP TABLE customer_split_line');
}
}