migrations/Version20230717123226.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 Version20230717123226 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('CREATE SEQUENCE project_report_employee_price_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
  19.         $this->addSql('CREATE TABLE project_report_employee_price (id INT NOT NULL, employee_id INT NOT NULL, project_report_id INT NOT NULL, price INT NOT NULL, k DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))');
  20.         $this->addSql('CREATE INDEX IDX_3406DE978C03F15C ON project_report_employee_price (employee_id)');
  21.         $this->addSql('CREATE INDEX IDX_3406DE975AEEE117 ON project_report_employee_price (project_report_id)');
  22.         $this->addSql('ALTER TABLE project_report_employee_price ADD CONSTRAINT FK_3406DE978C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  23.         $this->addSql('ALTER TABLE project_report_employee_price ADD CONSTRAINT FK_3406DE975AEEE117 FOREIGN KEY (project_report_id) REFERENCES project_report (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('CREATE SCHEMA public');
  29.         $this->addSql('DROP SEQUENCE project_report_employee_price_id_seq CASCADE');
  30.         $this->addSql('ALTER TABLE project_report_employee_price DROP CONSTRAINT FK_3406DE978C03F15C');
  31.         $this->addSql('ALTER TABLE project_report_employee_price DROP CONSTRAINT FK_3406DE975AEEE117');
  32.         $this->addSql('DROP TABLE project_report_employee_price');
  33.     }
  34. }