migrations/Version20230717122738.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 Version20230717122738 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('DROP SEQUENCE project_department_price_id_seq CASCADE');
  19.         $this->addSql('DROP SEQUENCE project_report_department_price_id_seq CASCADE');
  20.         $this->addSql('ALTER TABLE project_department_price DROP CONSTRAINT fk_6cee5eac166d1f9c');
  21.         $this->addSql('ALTER TABLE project_department_price DROP CONSTRAINT fk_6cee5eacae80f5df');
  22.         $this->addSql('ALTER TABLE project_report_department_price DROP CONSTRAINT fk_8bd6e9b85aeee117');
  23.         $this->addSql('ALTER TABLE project_report_department_price DROP CONSTRAINT fk_8bd6e9b8ae80f5df');
  24.         $this->addSql('DROP TABLE project_department_price');
  25.         $this->addSql('DROP TABLE project_report_department_price');
  26.         $this->addSql('ALTER TABLE department ALTER is_pm DROP DEFAULT');
  27.         $this->addSql('CREATE UNIQUE INDEX UNIQ_5D9F75A15E237E06 ON employee (name)');
  28.         $this->addSql('ALTER TABLE month ALTER year DROP DEFAULT');
  29.         $this->addSql('ALTER TABLE project_report ALTER payment_status DROP DEFAULT');
  30.         $this->addSql('ALTER TABLE project_report ALTER act_status DROP DEFAULT');
  31.         $this->addSql('ALTER TABLE project_report ALTER monthly_k DROP DEFAULT');
  32.         $this->addSql('ALTER TABLE project_report ALTER plan DROP DEFAULT');
  33.         $this->addSql('ALTER TABLE project_report ALTER kpi DROP DEFAULT');
  34.         $this->addSql('ALTER TABLE project_report ALTER is_code_sent DROP DEFAULT');
  35.     }
  36.     public function down(Schema $schema): void
  37.     {
  38.         // this down() migration is auto-generated, please modify it to your needs
  39.         $this->addSql('CREATE SCHEMA public');
  40.         $this->addSql('CREATE SEQUENCE project_department_price_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  41.         $this->addSql('CREATE SEQUENCE project_report_department_price_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  42.         $this->addSql('CREATE TABLE project_department_price (id INT NOT NULL, project_id INT DEFAULT NULL, department_id INT DEFAULT NULL, price INT DEFAULT NULL, price_customer INT DEFAULT NULL, PRIMARY KEY(id))');
  43.         $this->addSql('CREATE INDEX idx_6cee5eacae80f5df ON project_department_price (department_id)');
  44.         $this->addSql('CREATE INDEX idx_6cee5eac166d1f9c ON project_department_price (project_id)');
  45.         $this->addSql('CREATE TABLE project_report_department_price (id INT NOT NULL, project_report_id INT DEFAULT NULL, department_id INT DEFAULT NULL, price INT DEFAULT NULL, price_customer INT DEFAULT NULL, PRIMARY KEY(id))');
  46.         $this->addSql('CREATE INDEX idx_8bd6e9b8ae80f5df ON project_report_department_price (department_id)');
  47.         $this->addSql('CREATE INDEX idx_8bd6e9b85aeee117 ON project_report_department_price (project_report_id)');
  48.         $this->addSql('ALTER TABLE project_department_price ADD CONSTRAINT fk_6cee5eac166d1f9c FOREIGN KEY (project_id) REFERENCES project (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  49.         $this->addSql('ALTER TABLE project_department_price ADD CONSTRAINT fk_6cee5eacae80f5df FOREIGN KEY (department_id) REFERENCES department (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  50.         $this->addSql('ALTER TABLE project_report_department_price ADD CONSTRAINT fk_8bd6e9b85aeee117 FOREIGN KEY (project_report_id) REFERENCES project_report (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  51.         $this->addSql('ALTER TABLE project_report_department_price ADD CONSTRAINT fk_8bd6e9b8ae80f5df FOREIGN KEY (department_id) REFERENCES department (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  52.         $this->addSql('DROP INDEX UNIQ_5D9F75A15E237E06');
  53.         $this->addSql('ALTER TABLE month ALTER year SET DEFAULT 0');
  54.         $this->addSql('ALTER TABLE project_report ALTER act_status SET DEFAULT 10');
  55.         $this->addSql('ALTER TABLE project_report ALTER payment_status SET DEFAULT 10');
  56.         $this->addSql('ALTER TABLE project_report ALTER monthly_k SET DEFAULT \'1\'');
  57.         $this->addSql('ALTER TABLE project_report ALTER plan SET DEFAULT 800');
  58.         $this->addSql('ALTER TABLE project_report ALTER kpi SET DEFAULT 0');
  59.         $this->addSql('ALTER TABLE project_report ALTER is_code_sent SET DEFAULT false');
  60.         $this->addSql('ALTER TABLE department ALTER is_pm SET DEFAULT false');
  61.     }
  62. }