diff --git a/migrations/Version20260316103235.php b/migrations/Version20260316103235.php new file mode 100644 index 0000000..f4942a0 --- /dev/null +++ b/migrations/Version20260316103235.php @@ -0,0 +1,31 @@ +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'); + } +} diff --git a/migrations/Version20260316104254.php b/migrations/Version20260316104254.php new file mode 100644 index 0000000..baf28d0 --- /dev/null +++ b/migrations/Version20260316104254.php @@ -0,0 +1,31 @@ +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'); + } +} diff --git a/migrations/Version20260316104335.php b/migrations/Version20260316104335.php new file mode 100644 index 0000000..ebcb3db --- /dev/null +++ b/migrations/Version20260316104335.php @@ -0,0 +1,31 @@ +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'); + } +} diff --git a/migrations/Version20260316104505.php b/migrations/Version20260316104505.php new file mode 100644 index 0000000..c68c5fd --- /dev/null +++ b/migrations/Version20260316104505.php @@ -0,0 +1,31 @@ +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'); + } +} diff --git a/migrations/Version20260316104557.php b/migrations/Version20260316104557.php new file mode 100644 index 0000000..bcd88dc --- /dev/null +++ b/migrations/Version20260316104557.php @@ -0,0 +1,33 @@ +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'); + } +} diff --git a/migrations/Version20260316114715.php b/migrations/Version20260316114715.php new file mode 100644 index 0000000..39c2cf5 --- /dev/null +++ b/migrations/Version20260316114715.php @@ -0,0 +1,49 @@ +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'); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index b0ec9e4..59874d8 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -50,7 +50,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?bool $hasNextcloudAccess = null; #[ORM\Column(length: 255)] - private ?string $nextcloudQuota = null; + private ?string $nextcloudQuota = '1G'; #[ORM\Column] private ?bool $hasMobilizon = null; @@ -59,10 +59,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?bool $hasAgoraAccess = null; #[ORM\Column(length: 255)] - private ?string $lastname = null; + private ?string $lastName = null; #[ORM\Column(length: 255)] - private ?string $firstname = null; + private ?string $firstName = null; public function getId(): ?Uuid { @@ -242,26 +242,26 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface 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; } - 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; }