migrations/Version20250729121911.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 Version20250729121911 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_employee_consent_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_351A097FD17F50A6 (uuid), 
  33.                     INDEX IDX_351A097F3D8E604F (parent), 
  34.                     PRIMARY KEY(id)             
  35.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  36.                 '
  37.         );
  38.         $this->addSql(
  39.             '
  40.                 ALTER TABLE sob_employee_consent_document ADD CONSTRAINT FK_351A097F3D8E604F FOREIGN KEY 
  41.                     (parent) REFERENCES sob_record (id) ON DELETE CASCADE
  42.                 '
  43.         );
  44.     }
  45.     public function down(Schema $schema): void
  46.     {
  47.         // this down() migration is auto-generated, please modify it to your needs
  48.         $this->addSql('ALTER TABLE sob_employee_consent_document DROP FOREIGN KEY FK_351A097F3D8E604F');
  49.         $this->addSql('DROP TABLE sob_employee_consent_document');
  50.     }
  51. }