migrations/Version20260825104148.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20260825104148 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE access_modules CHANGE access_module_role access_module_role ENUM(\'intern\', \'extern\') DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE calculation_permissions CHANGE type type ENUM(\'total\', \'average\', \'profit\', \'margin\', \'detail_report\') NOT NULL');
  20.         $this->addSql('ALTER TABLE desktop_settings CHANGE default_language default_language ENUM(\'de\', \'en\', \'tr\') DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE material_request CHANGE status status ENUM(\'draft\', \'submitted\', \'ordered\', \'partially_ordered\', \'rejected\') DEFAULT \'draft\' NOT NULL');
  22.         $this->addSql('ALTER TABLE material_request_documents ADD free_text LONGTEXT DEFAULT NULL, CHANGE file_name file_name VARCHAR(255) DEFAULT NULL, CHANGE file_path file_path VARCHAR(255) DEFAULT NULL, CHANGE status status ENUM(\'pending\', \'ordered\', \'partially_ordered\', \'rejected\') DEFAULT \'pending\' NOT NULL');
  23.         $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\', \'service\', \'production\') DEFAULT NULL, CHANGE status status ENUM(\'draft\', \'published\') DEFAULT \'draft\' NOT NULL, CHANGE decline_reason_category decline_reason_category ENUM(\'supply\', \'personnel\', \'weather\', \'scope_change\', \'other\') DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE project_order_task_fulfillment_date_revisions CHANGE reason_category reason_category ENUM(\'supply\', \'personnel\', \'weather\', \'scope_change\', \'other\') DEFAULT NULL');
  25.         $this->addSql('ALTER TABLE project_order_task_fulfillment_messages CHANGE sender_side sender_side ENUM(\'owner\', \'executor\') NOT NULL');
  26.         $this->addSql('ALTER TABLE projects CHANGE type type ENUM(\'project\', \'daily_work\') DEFAULT \'project\'');
  27.         $this->addSql('ALTER TABLE purchase_request_histories CHANGE sender_mode sender_mode ENUM(\'approver\', \'requester\') DEFAULT NULL');
  28.         $this->addSql('ALTER TABLE purchase_request_status CHANGE status status ENUM(\'pending\', \'approved\', \'rejected\', \'delivered\') NOT NULL');
  29.         $this->addSql('ALTER TABLE stock_transactions CHANGE transaction_type transaction_type ENUM(\'in\', \'out\', \'move\') NOT NULL');
  30.         $this->addSql('ALTER TABLE task_fulfillment_stage_history CHANGE changed_by_scope changed_by_scope ENUM(\'internal\', \'external\') DEFAULT NULL, CHANGE source source ENUM(\'service\', \'erp\', \'system\') NOT NULL');
  31.         $this->addSql('ALTER TABLE task_fulfillment_stages CHANGE work_nature work_nature ENUM(\'support\', \'service\', \'production\') DEFAULT NULL');
  32.         $this->addSql('ALTER TABLE todo_notifications CHANGE status status ENUM(\'pending\', \'accepted\', \'in_process\', \'awaiting_confirmation\', \'completed\', \'rejected\') DEFAULT NULL, CHANGE type type ENUM(\'status\', \'comment\', \'new_todo\', \'case_closed\') DEFAULT \'status\' NOT NULL');
  33.         $this->addSql('ALTER TABLE todos CHANGE priority priority ENUM(\'low\', \'medium\', \'high\', \'critical\') NOT NULL, CHANGE type type ENUM(\'bug\', \'improvement\', \'suggestion\') NOT NULL, CHANGE status status ENUM(\'pending\', \'accepted\', \'in_process\', \'awaiting_confirmation\', \'completed\', \'rejected\') NOT NULL, CHANGE ai_status ai_status ENUM(\'queued\', \'in_progress\', \'done\', \'failed\') DEFAULT NULL');
  34.         $this->addSql('ALTER TABLE vendor CHANGE vendor_type vendor_type ENUM(\'company\', \'freelancer\') DEFAULT NULL, CHANGE vendor_status vendor_status ENUM(\'active\', \'inactive\') DEFAULT \'active\' NOT NULL');
  35.         $this->addSql('DROP INDEX unique_personal_id ON worker');
  36.         $this->addSql('CREATE UNIQUE INDEX unique_personal_id ON worker (personal_id)');
  37.         $this->addSql('ALTER TABLE works_plan_revisions CHANGE status status ENUM(\'requested\', \'granted\', \'denied\', \'submitted\', \'approved\', \'rejected\', \'withdrawn\') NOT NULL');
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         // this down() migration is auto-generated, please modify it to your needs
  42.         $this->addSql('ALTER TABLE access_modules CHANGE access_module_role access_module_role VARCHAR(255) DEFAULT NULL');
  43.         $this->addSql('ALTER TABLE calculation_permissions CHANGE type type VARCHAR(255) NOT NULL');
  44.         $this->addSql('ALTER TABLE desktop_settings CHANGE default_language default_language VARCHAR(255) DEFAULT NULL');
  45.         $this->addSql('ALTER TABLE material_request CHANGE status status VARCHAR(255) DEFAULT \'draft\' NOT NULL');
  46.         $this->addSql('ALTER TABLE material_request_documents DROP free_text, CHANGE file_name file_name VARCHAR(255) NOT NULL, CHANGE file_path file_path VARCHAR(255) NOT NULL, CHANGE status status VARCHAR(255) DEFAULT \'pending\' NOT NULL');
  47.         $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, CHANGE status status VARCHAR(255) DEFAULT \'draft\' NOT NULL, CHANGE decline_reason_category decline_reason_category VARCHAR(255) DEFAULT NULL');
  48.         $this->addSql('ALTER TABLE project_order_task_fulfillment_date_revisions CHANGE reason_category reason_category VARCHAR(255) DEFAULT NULL');
  49.         $this->addSql('ALTER TABLE project_order_task_fulfillment_messages CHANGE sender_side sender_side VARCHAR(255) NOT NULL');
  50.         $this->addSql('ALTER TABLE projects CHANGE type type VARCHAR(255) DEFAULT \'project\'');
  51.         $this->addSql('ALTER TABLE purchase_request_histories CHANGE sender_mode sender_mode VARCHAR(255) DEFAULT NULL');
  52.         $this->addSql('ALTER TABLE purchase_request_status CHANGE status status VARCHAR(255) NOT NULL');
  53.         $this->addSql('ALTER TABLE stock_transactions CHANGE transaction_type transaction_type VARCHAR(255) NOT NULL');
  54.         $this->addSql('ALTER TABLE task_fulfillment_stage_history CHANGE changed_by_scope changed_by_scope VARCHAR(255) DEFAULT NULL, CHANGE source source VARCHAR(255) NOT NULL');
  55.         $this->addSql('ALTER TABLE task_fulfillment_stages CHANGE work_nature work_nature VARCHAR(255) DEFAULT NULL');
  56.         $this->addSql('ALTER TABLE todo_notifications CHANGE type type VARCHAR(255) DEFAULT \'status\' NOT NULL, CHANGE status status VARCHAR(255) DEFAULT NULL');
  57.         $this->addSql('ALTER TABLE todos CHANGE priority priority VARCHAR(255) NOT NULL, CHANGE type type VARCHAR(255) NOT NULL, CHANGE status status VARCHAR(255) NOT NULL, CHANGE ai_status ai_status VARCHAR(255) DEFAULT NULL');
  58.         $this->addSql('ALTER TABLE vendor CHANGE vendor_type vendor_type VARCHAR(255) DEFAULT NULL, CHANGE vendor_status vendor_status VARCHAR(255) DEFAULT \'active\' NOT NULL');
  59.         $this->addSql('DROP INDEX unique_personal_id ON worker');
  60.         $this->addSql('CREATE UNIQUE INDEX unique_personal_id ON worker (personal_id)');
  61.         $this->addSql('ALTER TABLE works_plan_revisions CHANGE status status VARCHAR(255) NOT NULL');
  62.     }
  63. }