feat: add Import entity with batch tracking

This commit is contained in:
thibaud-leclere
2026-03-29 10:11:30 +02:00
parent 5f7ddcd3cc
commit 7be4de6967
3 changed files with 230 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?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 Version20260329000002 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 import (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, user_id INT NOT NULL, file_path VARCHAR(255) NOT NULL, status VARCHAR(20) NOT NULL, total_batches INT NOT NULL, processed_batches INT NOT NULL, total_films INT NOT NULL, failed_films INT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, completed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_9D4ECE1DA76ED395 ON import (user_id)');
$this->addSql('COMMENT ON COLUMN import.created_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN import.completed_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE import ADD CONSTRAINT FK_9D4ECE1DA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE import DROP CONSTRAINT FK_9D4ECE1DA76ED395');
$this->addSql('DROP TABLE import');
}
}