<?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 Version20220110100350 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, business_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, event VARCHAR(255) NOT NULL, points VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, date DATETIME NOT NULL, expires DATETIME DEFAULT NULL, INDEX IDX_723705D1A89DB457 (business_id), INDEX IDX_723705D19395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1A89DB457 FOREIGN KEY (business_id) REFERENCES business (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D19395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE transaction');
}
}