ogcore/migrations/Version20240703090301.php

36 lines
1.9 KiB
PHP

<?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 Version20240703090301 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 image (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, software_profile_id INT NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', migration_id VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, created_by VARCHAR(255) DEFAULT NULL, updated_by VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, comments VARCHAR(255) DEFAULT NULL, path VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, revision VARCHAR(255) DEFAULT NULL, info VARCHAR(255) DEFAULT NULL, size INT NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_C53D045FD17F50A6 (uuid), INDEX IDX_C53D045F19EB6921 (client_id), INDEX IDX_C53D045FED42A742 (software_profile_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045F19EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045FED42A742 FOREIGN KEY (software_profile_id) REFERENCES software_profile (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045F19EB6921');
$this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045FED42A742');
$this->addSql('DROP TABLE image');
}
}