12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?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 Version20250803035835 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 party (id INT AUTO_INCREMENT NOT NULL, gamemaster_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', game_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', event_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', start_on DATETIME DEFAULT NULL, end_on DATETIME DEFAULT NULL, gamemaster_is_author TINYINT(1) DEFAULT NULL, min_participants INT DEFAULT NULL, max_participants INT DEFAULT NULL, INDEX IDX_89954EE096376157 (gamemaster_id), INDEX IDX_89954EE0E48FD905 (game_id), INDEX IDX_89954EE071F7E88B (event_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('ALTER TABLE party ADD CONSTRAINT FK_89954EE096376157 FOREIGN KEY (gamemaster_id) REFERENCES gamemaster (id)');
- $this->addSql('ALTER TABLE party ADD CONSTRAINT FK_89954EE0E48FD905 FOREIGN KEY (game_id) REFERENCES game (id)');
- $this->addSql('ALTER TABLE party ADD CONSTRAINT FK_89954EE071F7E88B FOREIGN KEY (event_id) REFERENCES event (id)');
- $this->addSql('ALTER TABLE slot ADD party_id INT DEFAULT NULL');
- $this->addSql('ALTER TABLE slot ADD CONSTRAINT FK_AC0E2067213C1059 FOREIGN KEY (party_id) REFERENCES party (id)');
- $this->addSql('CREATE INDEX IDX_AC0E2067213C1059 ON slot (party_id)');
- }
- public function down(Schema $schema): void
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->addSql('ALTER TABLE slot DROP FOREIGN KEY FK_AC0E2067213C1059');
- $this->addSql('ALTER TABLE party DROP FOREIGN KEY FK_89954EE096376157');
- $this->addSql('ALTER TABLE party DROP FOREIGN KEY FK_89954EE0E48FD905');
- $this->addSql('ALTER TABLE party DROP FOREIGN KEY FK_89954EE071F7E88B');
- $this->addSql('DROP TABLE party');
- $this->addSql('DROP INDEX IDX_AC0E2067213C1059 ON slot');
- $this->addSql('ALTER TABLE slot DROP party_id');
- }
- }
|