✨ feat(newsletter): Affiche le nombre de contacts dans la liste et crée la relation.
This commit is contained in:
36
migrations/Version20250801084410.php
Normal file
36
migrations/Version20250801084410.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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 Version20250801084410 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 contact_line (id SERIAL NOT NULL, list_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, surname VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, uuid UUID NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_F9EB36093DAE168B ON contact_line (list_id)');
|
||||
$this->addSql('COMMENT ON COLUMN contact_line.uuid IS \'(DC2Type:uuid)\'');
|
||||
$this->addSql('ALTER TABLE contact_line ADD CONSTRAINT FK_F9EB36093DAE168B FOREIGN KEY (list_id) REFERENCES contact (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 contact_line DROP CONSTRAINT FK_F9EB36093DAE168B');
|
||||
$this->addSql('DROP TABLE contact_line');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user