WIP change animator field to animator intern and animator extern

This commit is contained in:
2025-07-01 14:29:01 +02:00
parent e176319775
commit 4c3befe489
4 changed files with 45 additions and 88 deletions

View File

@@ -1,63 +0,0 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Event;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250619102259 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add animator entity to event module';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
CREATE SEQUENCE chill_event_animator_id_seq INCREMENT BY 1 MINVALUE 1 START 1
SQL);
$this->addSql(<<<'SQL'
CREATE TABLE chill_event_animator (id INT NOT NULL, thirdparty_id INT DEFAULT NULL, user_id INT DEFAULT NULL, event_id INT NOT NULL, PRIMARY KEY(id))
SQL);
$this->addSql(<<<'SQL'
CREATE INDEX IDX_A7FA35FEC7D3A8E6 ON chill_event_animator (thirdparty_id)
SQL);
$this->addSql(<<<'SQL'
CREATE INDEX IDX_A7FA35FEA76ED395 ON chill_event_animator (user_id)
SQL);
$this->addSql(<<<'SQL'
CREATE INDEX IDX_A7FA35FE71F7E88B ON chill_event_animator (event_id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator ADD CONSTRAINT FK_A7FA35FEC7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator ADD CONSTRAINT FK_A7FA35FEA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator ADD CONSTRAINT FK_A7FA35FE71F7E88B FOREIGN KEY (event_id) REFERENCES chill_event_event (id) NOT DEFERRABLE INITIALLY IMMEDIATE
SQL);
}
public function down(Schema $schema): void
{
$this->addSql(<<<'SQL'
DROP SEQUENCE chill_event_animator_id_seq CASCADE
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator DROP CONSTRAINT FK_A7FA35FEC7D3A8E6
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator DROP CONSTRAINT FK_A7FA35FEA76ED395
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_animator DROP CONSTRAINT FK_A7FA35FE71F7E88B
SQL);
$this->addSql(<<<'SQL'
DROP TABLE chill_event_animator
SQL);
}
}