Clean migration for budget bundle

This commit is contained in:
Julie Lenaerts 2024-09-19 14:37:31 +02:00 committed by Julien Fastré
parent f2eaf23c2a
commit de711181df
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 32 additions and 4 deletions

View File

@ -37,13 +37,13 @@ class ChargeKind
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, options: ['default' => ''], nullable: false)]
private string $kind = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])]
private array $name = [];
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
private float $ordering = 0.00;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])]
private array $tags = [];
public function getId(): ?int

View File

@ -39,13 +39,13 @@ class ResourceKind
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => ''])]
private string $kind = '';
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])]
private array $name = [];
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
private float $ordering = 0.00;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])]
private array $tags = [];
public function getId(): ?int

View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Budget;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240918143139 extends AbstractMigration
{
public function getDescription(): string
{
return 'Remove familymember column from resource and charge table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_budget.charge DROP familymember_id');
$this->addSql('ALTER TABLE chill_budget.resource DROP familymember_id');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_budget.resource ADD familymember_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_budget.charge ADD familymember_id INT DEFAULT NULL');
}
}