<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260914120200 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create furious_purchase table (migration Furious phases 3 et 4)';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE furious_purchase (id INT AUTO_INCREMENT NOT NULL, source_id VARCHAR(64) NOT NULL, furious_id INT DEFAULT NULL, project_source_id VARCHAR(64) NOT NULL, expense_type VARCHAR(16) NOT NULL, cost_name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, amount_ht DOUBLE PRECISION NOT NULL, vat DOUBLE PRECISION NOT NULL, currency VARCHAR(8) NOT NULL, type_achat VARCHAR(64) NOT NULL, invoice_date DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', document_date DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\', invoice_number VARCHAR(64) DEFAULT NULL, external_reference VARCHAR(64) NOT NULL, who INT NOT NULL, supplier_id INT DEFAULT NULL, statut INT NOT NULL, paiement_date DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\', is_billable TINYINT(1) NOT NULL, tags LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', custom_fields LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', UNIQUE INDEX uniq_furious_purchase_source (source_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE furious_purchase');
}
}