36 lines
1.2 KiB
PHP
36 lines
1.2 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 Version20240619104206 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('ALTER TABLE `partition` ADD operative_system_id INT DEFAULT NULL, DROP os_name');
|
|
$this->addSql('ALTER TABLE `partition` ADD CONSTRAINT FK_9EB910E4F1E9F66E FOREIGN KEY (operative_system_id) REFERENCES operative_system (id)');
|
|
$this->addSql('CREATE INDEX IDX_9EB910E4F1E9F66E ON `partition` (operative_system_id)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE `partition` DROP FOREIGN KEY FK_9EB910E4F1E9F66E');
|
|
$this->addSql('DROP INDEX IDX_9EB910E4F1E9F66E ON `partition`');
|
|
$this->addSql('ALTER TABLE `partition` ADD os_name VARCHAR(255) NOT NULL, DROP operative_system_id');
|
|
}
|
|
}
|