<?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 Version20230717181956 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('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');
$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');
$this->addSql('ALTER TABLE rh_salary_credit ADD CONSTRAINT FK_8DA347574758967C FOREIGN KEY (rh_salary_id) REFERENCES rh_salary (id)');
$this->addSql('ALTER TABLE rh_salary_credit ADD CONSTRAINT FK_8DA347578565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('ALTER TABLE rh_salary_credit_shedul ADD CONSTRAINT FK_E5F4A783FF55D618 FOREIGN KEY (rh_salary_credit_id) REFERENCES rh_salary_credit (id)');
$this->addSql('ALTER TABLE rh_salary_credit_shedul ADD CONSTRAINT FK_E5F4A7838565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
$this->addSql('ALTER TABLE registration_student_pre_registration ADD num_cmu VARCHAR(60) DEFAULT NULL');
$this->addSql('ALTER TABLE rh_pay_slip_retained_item ADD rh_salary_credit_shedul_id INT DEFAULT NULL');
$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)');
$this->addSql('CREATE INDEX IDX_D84784ADDEA47C27 ON rh_pay_slip_retained_item (rh_salary_credit_shedul_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rh_salary_credit_shedul DROP FOREIGN KEY FK_E5F4A783FF55D618');
$this->addSql('ALTER TABLE rh_pay_slip_retained_item DROP FOREIGN KEY FK_D84784ADDEA47C27');
$this->addSql('DROP TABLE rh_salary_credit');
$this->addSql('DROP TABLE rh_salary_credit_shedul');
$this->addSql('ALTER TABLE registration_student_pre_registration DROP num_cmu');
$this->addSql('DROP INDEX IDX_D84784ADDEA47C27 ON rh_pay_slip_retained_item');
$this->addSql('ALTER TABLE rh_pay_slip_retained_item DROP rh_salary_credit_shedul_id');
}
}