<?php
/* @noinspection PhpUnused */
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*
* @package API
* @internal
*/
final class Version20241210120057 extends AbstractMigration
{
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE skill_screening_document DROP FOREIGN KEY FK_36F55D7D3D8E604F');
$this->addSql('DROP TABLE skill_screening_document');
}
public function getDescription(): string
{
return
"- Introduces skill screening document table.";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'
CREATE TABLE skill_screening_document (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
parent INT NOT NULL COMMENT \'Internal ID\',
created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
uuid VARCHAR(36) NOT NULL COMMENT \'UUID for file\',
name VARCHAR(225) NOT NULL COMMENT \'Name for file\',
mime_type VARCHAR(32) NOT NULL COMMENT \'MIME type for file\',
hash VARCHAR(32) NOT NULL COMMENT \'Hash for file\',
extension VARCHAR(3) NOT NULL COMMENT \'Extension for file\',
property_name VARCHAR(32) NOT NULL COMMENT \'Property name for file\',
UNIQUE INDEX UNIQ_36F55D7DD17F50A6 (uuid),
INDEX IDX_36F55D7D3D8E604F (parent),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE skill_screening_document ADD CONSTRAINT FK_36F55D7D3D8E604F
FOREIGN KEY (parent) REFERENCES skill_screening (id) ON DELETE CASCADE
'
);
}
}