<?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 Version20220406062118 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 transaction (id INT AUTO_INCREMENT NOT NULL, from_group_id INT DEFAULT NULL, to_group_id INT DEFAULT NULL, sender_id INT DEFAULT NULL, recipient_id INT DEFAULT NULL, office_id INT DEFAULT NULL, amount DOUBLE PRECISION NOT NULL, typeof VARCHAR(255) DEFAULT NULL, comment VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_723705D1B8BB39DD (from_group_id), INDEX IDX_723705D1330D47E9 (to_group_id), INDEX IDX_723705D1F624B39D (sender_id), INDEX IDX_723705D1E92F8F78 (recipient_id), INDEX IDX_723705D1FFA0C224 (office_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1B8BB39DD FOREIGN KEY (from_group_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1330D47E9 FOREIGN KEY (to_group_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1F624B39D FOREIGN KEY (sender_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1E92F8F78 FOREIGN KEY (recipient_id) REFERENCES client (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1FFA0C224 FOREIGN KEY (office_id) REFERENCES office (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE transaction');
}
}