mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Clean migration for activity bundle
This commit is contained in:
parent
e043b0cf12
commit
f2eaf23c2a
@ -32,8 +32,8 @@ class ActivityReason
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name;
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* Get active.
|
||||
|
@ -31,11 +31,9 @@ class ActivityReasonCategory implements \Stringable
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private $name;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* Array of ActivityReason.
|
||||
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Activity;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240918142723 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Fix not null and default values for activityreason, activityreasoncategory, comments on activity';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activity ALTER privatecomment_comments SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE activityreason ALTER name SET DEFAULT \'{}\'');
|
||||
$this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL');
|
||||
$this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2');
|
||||
$this->addSql('ALTER TABLE activityreasoncategory ALTER name SET DEFAULT \'{}\'');
|
||||
$this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE activityreason ALTER name DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user