Reverse deleting of organizationCost property on event entity to keep db data

This commit is contained in:
Julie Lenaerts 2025-05-08 16:29:15 +02:00
parent 5e5d23c320
commit 61281a0900
2 changed files with 17 additions and 9 deletions

View File

@ -115,6 +115,12 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
#[Serializer\Groups(['read'])]
private Collection $budgetElements;
/**
* @deprecated use budgetElements instead
*/
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 4, nullable: true, options: ['default' => '0.0'])]
private string $organizationCost = '0.0';
/**
* Event constructor.
*/
@ -383,4 +389,15 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
{
$this->documents = $documents;
}
public function getOrganizationCost(): string
{
return $this->organizationCost;
}
public function setOrganizationCost(string $organizationCost): void
{
$this->organizationCost = $organizationCost;
}
}

View File

@ -14,9 +14,6 @@ namespace Chill\Migrations\Event;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250507073301 extends AbstractMigration
{
public function getDescription(): string
@ -41,9 +38,6 @@ final class Version20250507073301 extends AbstractMigration
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_thirdparty ADD CONSTRAINT FK_9946573EC7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_event DROP organizationcost
SQL);
}
public function down(Schema $schema): void
@ -57,8 +51,5 @@ final class Version20250507073301 extends AbstractMigration
$this->addSql(<<<'SQL'
DROP TABLE chill_event_thirdparty
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE chill_event_event ADD organizationcost NUMERIC(10, 4) DEFAULT '0.0'
SQL);
}
}