<?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 Version20250702073844 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 api_dict_bank_account (id UUID NOT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, name VARCHAR(255) NOT NULL, account_number VARCHAR(26) NOT NULL, acc_name VARCHAR(255) NOT NULL, code VARCHAR(255) DEFAULT NULL, is_active BOOLEAN DEFAULT true NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E7710088B1A4D127 ON api_dict_bank_account (account_number)');
$this->addSql('CREATE INDEX IDX_E7710088DE12AB56 ON api_dict_bank_account (created_by)');
$this->addSql('CREATE INDEX IDX_E771008816FE72E1 ON api_dict_bank_account (updated_by)');
$this->addSql('COMMENT ON COLUMN api_dict_bank_account.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN api_dict_bank_account.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN api_dict_bank_account.updated_by IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE api_dict_bank_account ADD CONSTRAINT FK_E7710088DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE api_dict_bank_account ADD CONSTRAINT FK_E771008816FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE fee ADD bank_account_id UUID DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN fee.bank_account_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE fee ADD CONSTRAINT FK_964964B512CB990C FOREIGN KEY (bank_account_id) REFERENCES api_dict_bank_account (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_964964B512CB990C ON fee (bank_account_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE fee DROP CONSTRAINT FK_964964B512CB990C');
$this->addSql('ALTER TABLE api_dict_bank_account DROP CONSTRAINT FK_E7710088DE12AB56');
$this->addSql('ALTER TABLE api_dict_bank_account DROP CONSTRAINT FK_E771008816FE72E1');
$this->addSql('DROP TABLE api_dict_bank_account');
$this->addSql('DROP INDEX IDX_964964B512CB990C');
$this->addSql('ALTER TABLE fee DROP bank_account_id');
}
}