<?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 Version20240813111057 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 v2_income_employee (id UUID NOT NULL, reporting_period_id UUID NOT NULL, wage_id UUID, ins_recipient_id INT NOT NULL, ins_source_id INT NOT NULL, ref_type VARCHAR(255), value NUMERIC(10, 2), created_at TIMESTAMP(0) WITHOUT TIME ZONE, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_A85F8E362832EB1C ON v2_income_employee (reporting_period_id)');
$this->addSql('CREATE INDEX IDX_A85F8E36C9E15D6A ON v2_income_employee (wage_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A85F8E362832EB1C8DC2A8571B9BC8DA ON v2_income_employee (reporting_period_id, ins_recipient_id, ins_source_id)');
$this->addSql('COMMENT ON COLUMN v2_income_employee.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_income_employee.reporting_period_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_income_employee.wage_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_income_employee.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE v2_income_employee ADD CONSTRAINT FK_A85F8E362832EB1C FOREIGN KEY (reporting_period_id) REFERENCES v2_reporting_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE v2_income_employee ADD CONSTRAINT FK_A85F8E36C9E15D6A FOREIGN KEY (wage_id) REFERENCES v2_wage (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE v2_income_employee');
}
}