creation de l'entite User #7

Open
maurine wants to merge 6 commits from feat/creation-entite into main
7 changed files with 217 additions and 11 deletions
Showing only changes of commit 8450372a97 - Show all commits

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 Version20260316103235 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" ALTER email_de_secours DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER email_de_secours SET NOT NULL');
}
}

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 Version20260316104254 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" ALTER identifiant_kaz DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER identifiant_kaz SET NOT NULL');
}
}

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 Version20260316104335 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" ALTER quota DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER quota SET NOT NULL');
}
}

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 Version20260316104505 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" ALTER has_agora_access DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER has_agora_access SET NOT NULL');
}
}

View File

@@ -0,0 +1,33 @@
<?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 Version20260316104557 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" ALTER has_nextcloud_access DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_mobilizon DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER has_nextcloud_access SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_mobilizon SET NOT NULL');
}
}

View File

@@ -0,0 +1,49 @@
<?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 Version20260316114715 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" ADD last_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" ADD first_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" DROP lastname');
$this->addSql('ALTER TABLE "user" DROP firstname');
$this->addSql('ALTER TABLE "user" ALTER email_de_secours SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER identifiant_kaz SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER quota SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_nextcloud_access SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_mobilizon SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_agora_access SET NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ADD lastname VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" ADD firstname VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" DROP last_name');
$this->addSql('ALTER TABLE "user" DROP first_name');
$this->addSql('ALTER TABLE "user" ALTER email_de_secours DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER identifiant_kaz DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER quota DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_nextcloud_access DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_mobilizon DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_agora_access DROP NOT NULL');
}
}

View File

@@ -50,7 +50,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
private ?bool $hasNextcloudAccess = null; private ?bool $hasNextcloudAccess = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
private ?string $nextcloudQuota = null; private ?string $nextcloudQuota = '1G';
#[ORM\Column] #[ORM\Column]
private ?bool $hasMobilizon = null; private ?bool $hasMobilizon = null;
@@ -59,10 +59,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
private ?bool $hasAgoraAccess = null; private ?bool $hasAgoraAccess = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
private ?string $lastname = null; private ?string $lastName = null;
#[ORM\Column(length: 255)] #[ORM\Column(length: 255)]
private ?string $firstname = null; private ?string $firstName = null;
public function getId(): ?Uuid public function getId(): ?Uuid
{ {
@@ -242,26 +242,26 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this; return $this;
} }
public function getLastname(): ?string public function getLastName(): ?string
{ {
return $this->lastname; return $this->lastName;
} }
public function setLastname(string $lastname): static public function setLastName(string $lastName): static
{ {
$this->lastname = $lastname; $this->lastName = $lastName;
return $this; return $this;
} }
public function getFirstname(): ?string public function getFirstName(): ?string
{ {
return $this->firstname; return $this->firstName;
} }
public function setFirstname(string $firstname): static public function setFirstName(string $firstName): static
{ {
$this->firstname = $firstname; $this->firstName = $firstName;
return $this; return $this;
} }