Updated migrations
testing/ogcore-api/pipeline/head This commit looks good Details

pull/21/head
Manuel Aranda Rosales 2025-03-04 12:53:05 +01:00
parent 8e21a10361
commit 0cf373303a
3 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250304115209 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user CHANGE groups_view groups_view VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user CHANGE groups_view groups_view VARCHAR(255) NOT NULL');
}
}

View File

@ -24,7 +24,7 @@ final class UserOutput extends AbstractOutput
#[Groups(['user:read'])]
public array $userGroups;
#[Groups(['user:read'])]
public string $groupsView;
public ?string $groupsView = 'card';
#[Groups(['user:read'])]
public \DateTime $createdAt;

View File

@ -51,7 +51,7 @@ class User extends AbstractEntity implements UserInterface, PasswordAuthenticate
private ?string $newPassword = null;
private ?string $repeatNewPassword = null;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, nullable: true)]
private ?string $groupsView = null;
@ -254,7 +254,7 @@ class User extends AbstractEntity implements UserInterface, PasswordAuthenticate
return $this->groupsView;
}
public function setGroupsView(string $groupsView): static
public function setGroupsView(?string $groupsView): static
{
$this->groupsView = $groupsView;