diff --git a/migrations/Version20241121141451.php b/migrations/Version20241121141451.php new file mode 100644 index 0000000..d51cde4 --- /dev/null +++ b/migrations/Version20241121141451.php @@ -0,0 +1,38 @@ +addSql('DROP SEQUENCE status_id_seq CASCADE'); + $this->addSql('DROP TABLE status'); + $this->addSql('ALTER TABLE userapp ADD is_verified BOOLEAN NOT NULL'); + $this->addSql('ALTER TABLE userapp ALTER roles SET NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('CREATE SEQUENCE status_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE status (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE userApp DROP is_verified'); + $this->addSql('ALTER TABLE userApp ALTER roles DROP NOT NULL'); + } +} diff --git a/migrations/Version20241121141722.php b/migrations/Version20241121141722.php new file mode 100644 index 0000000..6259ec7 --- /dev/null +++ b/migrations/Version20241121141722.php @@ -0,0 +1,40 @@ +addSql('ALTER TABLE userapp ALTER first_name DROP NOT NULL'); + $this->addSql('ALTER TABLE userapp ALTER last_name DROP NOT NULL'); + $this->addSql('ALTER TABLE userapp ALTER tel DROP NOT NULL'); + $this->addSql('ALTER TABLE userapp ALTER address DROP NOT NULL'); + $this->addSql('ALTER TABLE userapp ALTER mail DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE userApp ALTER first_name SET NOT NULL'); + $this->addSql('ALTER TABLE userApp ALTER last_name SET NOT NULL'); + $this->addSql('ALTER TABLE userApp ALTER tel SET NOT NULL'); + $this->addSql('ALTER TABLE userApp ALTER address SET NOT NULL'); + $this->addSql('ALTER TABLE userApp ALTER mail SET NOT NULL'); + } +} diff --git a/migrations/Version20241121141818.php b/migrations/Version20241121141818.php new file mode 100644 index 0000000..7eb43e8 --- /dev/null +++ b/migrations/Version20241121141818.php @@ -0,0 +1,31 @@ +addSql('CREATE SCHEMA public'); + } +} diff --git a/migrations/Version20241121141912.php b/migrations/Version20241121141912.php new file mode 100644 index 0000000..fbc5345 --- /dev/null +++ b/migrations/Version20241121141912.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE userapp ALTER is_verified DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE userApp ALTER is_verified SET NOT NULL'); + } +} diff --git a/migrations/Version20241121142119.php b/migrations/Version20241121142119.php new file mode 100644 index 0000000..44746a0 --- /dev/null +++ b/migrations/Version20241121142119.php @@ -0,0 +1,34 @@ +addSql('ALTER TABLE intern ALTER cover_letter DROP NOT NULL'); + $this->addSql('ALTER TABLE intern ALTER resume DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE intern ALTER cover_letter SET NOT NULL'); + $this->addSql('ALTER TABLE intern ALTER resume SET NOT NULL'); + } +} diff --git a/migrations/Version20241121142432.php b/migrations/Version20241121142432.php new file mode 100644 index 0000000..8226230 --- /dev/null +++ b/migrations/Version20241121142432.php @@ -0,0 +1,31 @@ +addSql('CREATE SCHEMA public'); + } +} diff --git a/migrations/Version20241121145353.php b/migrations/Version20241121145353.php new file mode 100644 index 0000000..439bd80 --- /dev/null +++ b/migrations/Version20241121145353.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE employee ALTER company_id DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE employee ALTER company_id SET NOT NULL'); + } +} diff --git a/src/Entity/UserApp.php b/src/Entity/UserApp.php index 8c00353..7dabaa2 100644 --- a/src/Entity/UserApp.php +++ b/src/Entity/UserApp.php @@ -28,8 +28,8 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface /** * @var list The user roles */ - #[ORM\Column(nullable: true)] - private ?array $roles = null; + #[ORM\Column] + private array $roles = []; /** * @var string The hashed password diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index 012084f..79b5342 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -3,6 +3,7 @@ namespace App\Form; use App\Entity\UserApp; +use Doctrine\DBAL\Types\StringType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; diff --git a/templates/registration/register.html.twig b/templates/registration/register.html.twig index 07ac084..edf72e9 100644 --- a/templates/registration/register.html.twig +++ b/templates/registration/register.html.twig @@ -51,5 +51,4 @@ {{ form_end(registrationForm) }} -{% endblock %} - +{% endblock %} \ No newline at end of file