mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-05 07:19:49 +00:00
Add metadata property to workflow to allow adding info about signatures needed
This commit is contained in:
parent
f2c5663b05
commit
babca5fc0f
@ -86,6 +86,9 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||||
private string $workflowName;
|
private string $workflowName;
|
||||||
|
|
||||||
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])]
|
||||||
|
private array $metadata = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->subscriberToFinal = new ArrayCollection();
|
$this->subscriberToFinal = new ArrayCollection();
|
||||||
@ -455,4 +458,14 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
return $this->steps->get($this->steps->count() - 2);
|
return $this->steps->get($this->steps->count() - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMetadata(): array
|
||||||
|
{
|
||||||
|
return $this->metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMetadata(array $metadata): void
|
||||||
|
{
|
||||||
|
$this->metadata = $metadata;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Main;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20240704150808 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Add a metadata property to the workflow entity';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_main_workflow_entity ADD metadata JSONB DEFAULT \'[]\' NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_main_workflow_entity DROP metadata');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user