<?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 Version20231204134314 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 invoice_automation (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, subscriber_id INT NOT NULL, invoice_number VARCHAR(255) NOT NULL, subject VARCHAR(255) DEFAULT NULL, merchant_email VARCHAR(255) DEFAULT NULL, merchant_phone VARCHAR(255) DEFAULT NULL, amount DOUBLE PRECISION NOT NULL, created DATETIME NOT NULL, approved DATETIME DEFAULT NULL, status VARCHAR(255) NOT NULL, approver_message LONGTEXT DEFAULT NULL, INDEX IDX_30AFEC706796D554 (merchant_id), INDEX IDX_30AFEC707808B1AD (subscriber_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE invoice_automation ADD CONSTRAINT FK_30AFEC706796D554 FOREIGN KEY (merchant_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE invoice_automation ADD CONSTRAINT FK_30AFEC707808B1AD FOREIGN KEY (subscriber_id) REFERENCES company (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE invoice_automation DROP FOREIGN KEY FK_30AFEC706796D554');
$this->addSql('ALTER TABLE invoice_automation DROP FOREIGN KEY FK_30AFEC707808B1AD');
$this->addSql('DROP TABLE invoice_automation');
}
}