<?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 Version20230908140933 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE action_log CHANGE body body LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE application_version CHANGE data data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE building_payment CHANGE parsed_data parsed_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE processed_flats CHANGE parsed_data parsed_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE residents CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('CREATE TABLE task_history (id INT AUTO_INCREMENT NOT NULL, task_id INT DEFAULT NULL, building_id INT NOT NULL, task_type_id INT DEFAULT NULL, task_subtype_id INT DEFAULT NULL, device_id VARCHAR(255) DEFAULT NULL, description VARCHAR(512) NOT NULL, status INT NOT NULL, created_at DATETIME NOT NULL, priority INT NOT NULL, updated_at DATETIME NOT NULL, display_flat_id VARCHAR(32) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, phoneNumber VARCHAR(32) DEFAULT NULL, createdBy VARCHAR(255) DEFAULT NULL, comment VARCHAR(255) DEFAULT NULL, change_date DATETIME DEFAULT NULL, INDEX IDX_385B5AA1FFFE75C0 (task_id), INDEX IDX_385B5AA14D2A7E12 (building_id), INDEX IDX_385B5AA1DAADA679 (task_type_id), INDEX IDX_385B5AA1923D6FF3 (task_subtype_id), INDEX IDX_385B5AA194A4C7D4 (device_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE task_history ADD CONSTRAINT FK_385B5AA1FFFE75C0 FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE task_history ADD CONSTRAINT FK_385B5AA14D2A7E12 FOREIGN KEY (building_id) REFERENCES building (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE task_history ADD CONSTRAINT FK_385B5AA1DAADA679 FOREIGN KEY (task_type_id) REFERENCES task_types (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE task_history ADD CONSTRAINT FK_385B5AA1923D6FF3 FOREIGN KEY (task_subtype_id) REFERENCES task_subtypes (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE task_history ADD CONSTRAINT FK_385B5AA194A4C7D4 FOREIGN KEY (device_id) REFERENCES devices (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
}
}