<?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 Version20250624155742 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 (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, company_id INT NOT NULL, workshop_id INT NOT NULL, num VARCHAR(255) NOT NULL, amount_ht DOUBLE PRECISION DEFAULT NULL, amount_ttc DOUBLE PRECISION DEFAULT NULL, paid TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_90651744A76ED395 (user_id), INDEX IDX_90651744979B1AD6 (company_id), INDEX IDX_906517441FDCE57C (workshop_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_90651744A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_90651744979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('ALTER TABLE invoice ADD CONSTRAINT FK_906517441FDCE57C FOREIGN KEY (workshop_id) REFERENCES workshop (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE invoice DROP FOREIGN KEY FK_90651744A76ED395');
$this->addSql('ALTER TABLE invoice DROP FOREIGN KEY FK_90651744979B1AD6');
$this->addSql('ALTER TABLE invoice DROP FOREIGN KEY FK_906517441FDCE57C');
$this->addSql('DROP TABLE invoice');
}
}