<?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 Version20230717122738 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 SEQUENCE project_department_price_id_seq CASCADE');
$this->addSql('DROP SEQUENCE project_report_department_price_id_seq CASCADE');
$this->addSql('ALTER TABLE project_department_price DROP CONSTRAINT fk_6cee5eac166d1f9c');
$this->addSql('ALTER TABLE project_department_price DROP CONSTRAINT fk_6cee5eacae80f5df');
$this->addSql('ALTER TABLE project_report_department_price DROP CONSTRAINT fk_8bd6e9b85aeee117');
$this->addSql('ALTER TABLE project_report_department_price DROP CONSTRAINT fk_8bd6e9b8ae80f5df');
$this->addSql('DROP TABLE project_department_price');
$this->addSql('DROP TABLE project_report_department_price');
$this->addSql('ALTER TABLE department ALTER is_pm DROP DEFAULT');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5D9F75A15E237E06 ON employee (name)');
$this->addSql('ALTER TABLE month ALTER year DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER payment_status DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER act_status DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER monthly_k DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER plan DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER kpi DROP DEFAULT');
$this->addSql('ALTER TABLE project_report ALTER is_code_sent DROP DEFAULT');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SEQUENCE project_department_price_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE project_report_department_price_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$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))');
$this->addSql('CREATE INDEX idx_6cee5eacae80f5df ON project_department_price (department_id)');
$this->addSql('CREATE INDEX idx_6cee5eac166d1f9c ON project_department_price (project_id)');
$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))');
$this->addSql('CREATE INDEX idx_8bd6e9b8ae80f5df ON project_report_department_price (department_id)');
$this->addSql('CREATE INDEX idx_8bd6e9b85aeee117 ON project_report_department_price (project_report_id)');
$this->addSql('ALTER TABLE project_department_price ADD CONSTRAINT fk_6cee5eac166d1f9c FOREIGN KEY (project_id) REFERENCES project (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE project_department_price ADD CONSTRAINT fk_6cee5eacae80f5df FOREIGN KEY (department_id) REFERENCES department (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$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');
$this->addSql('ALTER TABLE project_report_department_price ADD CONSTRAINT fk_8bd6e9b8ae80f5df FOREIGN KEY (department_id) REFERENCES department (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP INDEX UNIQ_5D9F75A15E237E06');
$this->addSql('ALTER TABLE month ALTER year SET DEFAULT 0');
$this->addSql('ALTER TABLE project_report ALTER act_status SET DEFAULT 10');
$this->addSql('ALTER TABLE project_report ALTER payment_status SET DEFAULT 10');
$this->addSql('ALTER TABLE project_report ALTER monthly_k SET DEFAULT \'1\'');
$this->addSql('ALTER TABLE project_report ALTER plan SET DEFAULT 800');
$this->addSql('ALTER TABLE project_report ALTER kpi SET DEFAULT 0');
$this->addSql('ALTER TABLE project_report ALTER is_code_sent SET DEFAULT false');
$this->addSql('ALTER TABLE department ALTER is_pm SET DEFAULT false');
}
}