migrations/Version20230717181956.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 Version20230717181956 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 TABLE rh_salary_credit (id INT AUTO_INCREMENT NOT NULL, rh_salary_id INT NOT NULL, establishment_id INT NOT NULL, amount DOUBLE PRECISION NOT NULL, pattern VARCHAR(128) DEFAULT NULL, create_date DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, INDEX IDX_8DA347574758967C (rh_salary_id), INDEX IDX_8DA347578565851 (establishment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE rh_salary_credit_shedul (id INT AUTO_INCREMENT NOT NULL, rh_salary_credit_id INT NOT NULL, establishment_id INT NOT NULL, amount DOUBLE PRECISION NOT NULL, date_due DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, INDEX IDX_E5F4A783FF55D618 (rh_salary_credit_id), INDEX IDX_E5F4A7838565851 (establishment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE rh_salary_credit ADD CONSTRAINT FK_8DA347574758967C FOREIGN KEY (rh_salary_id) REFERENCES rh_salary (id)');
  21.         $this->addSql('ALTER TABLE rh_salary_credit ADD CONSTRAINT FK_8DA347578565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  22.         $this->addSql('ALTER TABLE rh_salary_credit_shedul ADD CONSTRAINT FK_E5F4A783FF55D618 FOREIGN KEY (rh_salary_credit_id) REFERENCES rh_salary_credit (id)');
  23.         $this->addSql('ALTER TABLE rh_salary_credit_shedul ADD CONSTRAINT FK_E5F4A7838565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  24.         $this->addSql('ALTER TABLE registration_student_pre_registration ADD num_cmu VARCHAR(60) DEFAULT NULL');
  25.         $this->addSql('ALTER TABLE rh_pay_slip_retained_item ADD rh_salary_credit_shedul_id INT DEFAULT NULL');
  26.         $this->addSql('ALTER TABLE rh_pay_slip_retained_item ADD CONSTRAINT FK_D84784ADDEA47C27 FOREIGN KEY (rh_salary_credit_shedul_id) REFERENCES rh_salary_credit_shedul (id)');
  27.         $this->addSql('CREATE INDEX IDX_D84784ADDEA47C27 ON rh_pay_slip_retained_item (rh_salary_credit_shedul_id)');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE rh_salary_credit_shedul DROP FOREIGN KEY FK_E5F4A783FF55D618');
  33.         $this->addSql('ALTER TABLE rh_pay_slip_retained_item DROP FOREIGN KEY FK_D84784ADDEA47C27');
  34.         $this->addSql('DROP TABLE rh_salary_credit');
  35.         $this->addSql('DROP TABLE rh_salary_credit_shedul');
  36.         $this->addSql('ALTER TABLE registration_student_pre_registration DROP num_cmu');
  37.         $this->addSql('DROP INDEX IDX_D84784ADDEA47C27 ON rh_pay_slip_retained_item');
  38.         $this->addSql('ALTER TABLE rh_pay_slip_retained_item DROP rh_salary_credit_shedul_id');
  39.     }
  40. }