<?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 Version20260615222903 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 pages_help (id INT AUTO_INCREMENT NOT NULL, page_key VARCHAR(64) NOT NULL, language VARCHAR(8) NOT NULL, title VARCHAR(255) DEFAULT NULL, content LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX uniq_page_lang (page_key, language), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE access_modules CHANGE access_module_role access_module_role ENUM(\'intern\', \'extern\') DEFAULT NULL');
$this->addSql('ALTER TABLE calculation_permissions CHANGE type type ENUM(\'total\', \'average\', \'profit\', \'margin\', \'detail_report\') NOT NULL');
$this->addSql('ALTER TABLE project_order_task_fulfillment CHANGE execution_scope execution_scope ENUM(\'internal\', \'external\') DEFAULT NULL, CHANGE execution_work_nature execution_work_nature ENUM(\'support\', \'production\') DEFAULT NULL');
$this->addSql('ALTER TABLE projects CHANGE type type ENUM(\'project\', \'daily_work\') DEFAULT \'project\'');
$this->addSql('ALTER TABLE purchase_request_histories CHANGE sender_mode sender_mode ENUM(\'approver\', \'requester\') DEFAULT NULL');
$this->addSql('ALTER TABLE purchase_request_status CHANGE status status ENUM(\'pending\', \'approved\', \'rejected\', \'delivered\') NOT NULL');
$this->addSql('ALTER TABLE stock_transactions CHANGE transaction_type transaction_type ENUM(\'in\', \'out\', \'move\') NOT NULL');
$this->addSql('ALTER TABLE vendor CHANGE vendor_type vendor_type ENUM(\'company\', \'freelancer\') DEFAULT NULL, CHANGE vendor_status vendor_status ENUM(\'active\', \'inactive\') DEFAULT NULL');
$this->addSql('DROP INDEX unique_personal_id ON worker');
$this->addSql('CREATE UNIQUE INDEX unique_personal_id ON worker (personal_id)');
$this->addSql('ALTER TABLE works_plan_jobs ADD description LONGTEXT DEFAULT NULL, ADD weight_locked TINYINT(1) DEFAULT 0 NOT NULL, ADD is_end_note LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE works_plan_tasks ADD weight_locked TINYINT(1) DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE pages_help');
$this->addSql('ALTER TABLE access_modules CHANGE access_module_role access_module_role VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE calculation_permissions CHANGE type type VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE project_order_task_fulfillment CHANGE execution_scope execution_scope VARCHAR(255) DEFAULT NULL, CHANGE execution_work_nature execution_work_nature VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE projects CHANGE type type VARCHAR(255) DEFAULT \'project\'');
$this->addSql('ALTER TABLE purchase_request_histories CHANGE sender_mode sender_mode VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE purchase_request_status CHANGE status status VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE stock_transactions CHANGE transaction_type transaction_type VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE vendor CHANGE vendor_type vendor_type VARCHAR(255) DEFAULT NULL, CHANGE vendor_status vendor_status VARCHAR(255) DEFAULT NULL');
$this->addSql('DROP INDEX unique_personal_id ON worker');
$this->addSql('CREATE UNIQUE INDEX unique_personal_id ON worker (personal_id)');
$this->addSql('ALTER TABLE works_plan_jobs DROP description, DROP weight_locked, DROP is_end_note');
$this->addSql('ALTER TABLE works_plan_tasks DROP weight_locked');
}
}