migrations/Version20260325133654.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7. * Auto-generated Migration: Please modify to your needs!
  8. */
  9. final class Version20260325133654 extends AbstractMigration
  10. {
  11. public function getDescription(): string
  12. {
  13. return '';
  14. }
  15. public function up(Schema $schema): void
  16. {
  17. // this up() migration is auto-generated, please modify it to your needs
  18. $this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75D182060A');
  19. $this->addSql('DROP INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts');
  20. $this->addSql('ALTER TABLE channel_positioning_test_attempts DROP prospect_id');
  21. $this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_uuid prospect_id VARCHAR(255) NOT NULL');
  22. $this->addSql('ALTER TABLE contacts MODIFY id INT NOT NULL');
  23. $this->addSql('DROP INDEX `primary` ON contacts');
  24. $this->addSql('ALTER TABLE contacts DROP id, CHANGE uuid uuid VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
  25. $this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (uuid)');
  26. $this->addSql('DROP INDEX `primary` ON contacts');
  27. $this->addSql('ALTER TABLE contacts CHANGE uuid id VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
  28. $this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (id)');
  29. $this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_id VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
  30. $this->addSql('ALTER TABLE channel_positioning_test_attempts ADD CONSTRAINT FK_AEEA1A75D182060A FOREIGN KEY (prospect_id) REFERENCES contacts (id) ON DELETE CASCADE');
  31. $this->addSql('CREATE INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts (prospect_id)');
  32. }
  33. public function down(Schema $schema): void
  34. {
  35. // this down() migration is auto-generated, please modify it to your needs
  36. $this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75D182060A');
  37. $this->addSql('DROP INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts');
  38. $this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_id VARCHAR(255) NOT NULL');
  39. $this->addSql('DROP INDEX `PRIMARY` ON contacts');
  40. $this->addSql('ALTER TABLE contacts CHANGE id uuid VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
  41. $this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (uuid)');
  42. $this->addSql('ALTER TABLE contacts ADD id INT AUTO_INCREMENT NOT NULL, CHANGE uuid uuid VARCHAR(36) DEFAULT \'uuid()\', DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
  43. $this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_uuid VARCHAR(36) DEFAULT NULL');
  44. $this->addSql('ALTER TABLE channel_positioning_test_attempts ADD prospect_id INT NOT NULL');
  45. $this->addSql('ALTER TABLE channel_positioning_test_attempts ADD CONSTRAINT FK_AEEA1A75D182060A FOREIGN KEY (prospect_id) REFERENCES contacts (id) ON DELETE CASCADE');
  46. $this->addSql('CREATE INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts (prospect_id)');
  47. }
  48. }