<?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 Version20240521125442 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_fine (id UUID NOT NULL, reporting_period_id UUID NOT NULL, fine_reason_id UUID NOT NULL, date_assigned TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, ins_user_id INT NOT NULL, value NUMERIC(50, 2) NOT NULL, details VARCHAR(250) NOT NULL, created_by_ins_user_id INT DEFAULT NULL, created_by_name VARCHAR(100) NOT NULL, cancelled_by_ins_user_id INT DEFAULT NULL, cancelled_by_name VARCHAR(100) NOT NULL, cancelled_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_7EC84F5D2832EB1C ON v2_fine (reporting_period_id)');
$this->addSql('CREATE INDEX IDX_7EC84F5D3B8F347B ON v2_fine (fine_reason_id)');
$this->addSql('COMMENT ON COLUMN v2_fine.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.reporting_period_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.fine_reason_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.date_assigned IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.cancelled_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN v2_fine.updated_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE v2_fine ADD CONSTRAINT FK_7EC84F5D2832EB1C FOREIGN KEY (reporting_period_id) REFERENCES v2_reporting_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE v2_fine ADD CONSTRAINT FK_7EC84F5D3B8F347B FOREIGN KEY (fine_reason_id) REFERENCES fine_reason (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE v2_fine');
}
}