mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
Clean migration for budget bundle
This commit is contained in:
parent
f2eaf23c2a
commit
de711181df
@ -37,13 +37,13 @@ class ChargeKind
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, options: ['default' => ''], nullable: false)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, options: ['default' => ''], nullable: false)]
|
||||||
private string $kind = '';
|
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 = [];
|
private array $name = [];
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
|
||||||
private float $ordering = 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 = [];
|
private array $tags = [];
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
|
@ -39,13 +39,13 @@ class ResourceKind
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => ''])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => ''])]
|
||||||
private string $kind = '';
|
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 = [];
|
private array $name = [];
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])]
|
||||||
private float $ordering = 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 = [];
|
private array $tags = [];
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
|
@ -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');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user