<?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 Version20200904204552 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE accounting_entry_sale');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE accounting_entry_sale (id INT AUTO_INCREMENT NOT NULL, invoice_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_223CDFD8B03A8386 (created_by_id), INDEX IDX_223CDFD8896DBBDE (updated_by_id), UNIQUE INDEX UNIQ_223CDFD82989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE accounting_entry_sale ADD CONSTRAINT FK_223CDFD82989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');
$this->addSql('ALTER TABLE accounting_entry_sale ADD CONSTRAINT FK_223CDFD8896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE accounting_entry_sale ADD CONSTRAINT FK_223CDFD8B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
}
}