<?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 Version20240626073616 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('DROP TABLE backup_user_file_document_information');
$this->addSql('ALTER TABLE document ADD is_user_saved TINYINT(1) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE user_file_document ADD saved_document_user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_file_document ADD CONSTRAINT FK_87B7A8BB172F332F FOREIGN KEY (saved_document_user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_87B7A8BB172F332F ON user_file_document (saved_document_user_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE backup_user_file_document_information (id INT DEFAULT 0 NOT NULL, user_file_document_id INT NOT NULL, currency_id INT DEFAULT NULL, value VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, document_information_id INT NOT NULL, document_type_tag_id INT DEFAULT NULL, entity_type_tag_id INT DEFAULT NULL) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE `document` DROP is_user_saved');
$this->addSql('ALTER TABLE user_file_document DROP FOREIGN KEY FK_87B7A8BB172F332F');
$this->addSql('DROP INDEX IDX_87B7A8BB172F332F ON user_file_document');
$this->addSql('ALTER TABLE user_file_document DROP saved_document_user_id');
}
}