migrations/Version20250819093553.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 Version20250819093553 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(
  19.             '
  20.                 CREATE TABLE sob_event_document (
  21.                 id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\', 
  22.                 parent INT NOT NULL COMMENT \'Internal ID\', 
  23.                 created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\', 
  24.                 active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\', 
  25.                 last_active_date DATE DEFAULT NULL COMMENT \'Last active date\', 
  26.                 uuid VARCHAR(36) NOT NULL COMMENT \'UUID for file\', 
  27.                 name VARCHAR(225) NOT NULL COMMENT \'Name for file\', 
  28.                 mime_type VARCHAR(32) NOT NULL COMMENT \'MIME type for file\', 
  29.                 hash VARCHAR(32) NOT NULL COMMENT \'Hash for file\', 
  30.                 extension VARCHAR(3) NOT NULL COMMENT \'Extension for file\', 
  31.                 property_name VARCHAR(32) NOT NULL COMMENT \'Property name for file\', 
  32.                 UNIQUE INDEX UNIQ_DA5C7796D17F50A6 (uuid), 
  33.                 INDEX IDX_DA5C77963D8E604F (parent), 
  34.                 PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  35.             '
  36.         );
  37.         $this->addSql(
  38.             '
  39.                 ALTER TABLE sob_event_document ADD CONSTRAINT FK_DA5C77963D8E604F FOREIGN KEY 
  40.                     (parent) REFERENCES sob_event (id) ON DELETE CASCADE
  41.             '
  42.         );
  43.     }
  44.     public function down(Schema $schema): void
  45.     {
  46.         // this down() migration is auto-generated, please modify it to your needs
  47.         $this->addSql('ALTER TABLE sob_event_document DROP FOREIGN KEY FK_DA5C77963D8E604F');
  48.         $this->addSql('DROP TABLE sob_event_document');
  49.     }
  50. }