update model with old fields from v1 of framadate

This commit is contained in:
Tykayn 2021-04-19 22:26:49 +02:00 committed by tykayn
parent 750692b030
commit 32d966eac3
4 changed files with 727 additions and 626 deletions

10
doc/evolutions.md Executable file
View File

@ -0,0 +1,10 @@
# Évolutions
Après avoir modifié le modèle de données dans les Entity, lancez la commande pour mettre à jour les getter et setters
```bash
php bin/console make:entity --regenerate
```
et pour mettre à jour le schéma en base de données
```bash
php bin/console doctrine:schema:update --force
```

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 Version20210419202522 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
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
}
}

View File

@ -105,6 +105,18 @@ class Comment {
public function setPoll( ?Poll $poll ): self {
$this->poll = $poll;
return $this;
}
public function getPseudo(): ?string
{
return $this->pseudo;
}
public function setPseudo(string $pseudo): self
{
$this->pseudo = $pseudo;
return $this;
}
}

View File

@ -83,8 +83,8 @@
/**
* max number of stack of votes possible.
* limits the number of people who can answer. as long as you trust the people to give only one answer with a reliable system.
* @ORM\Column(type="number", nullable=true)
* @Serializer\Type("number")
* @ORM\Column(type="smallint", nullable=true)
* @Serializer\Type("smallint")
* @Serializer\Expose()
*/
public $votesMax;
@ -93,8 +93,8 @@
* max number of choices people can answer in a stack of vote. for text polls only, not date kind.
* by default, people can check as many answers as they want.
* If the question is "check your 3 favourite flavours" and displays 10 flavours, only the first 3 clicked will be taken into account. GUI should be able to make this clear and togglable so that people can change their 3 favourite flavours in their answer.
* @ORM\Column(type="number", nullable=true)
* @Serializer\Type("number")
* @ORM\Column(type="smallint", nullable=true)
* @Serializer\Type("smallint")
* @Serializer\Expose()
*/
public $choicesMax;
@ -638,4 +638,52 @@
return $this;
}
public function getVotesAllowed(): ?bool
{
return $this->votesAllowed;
}
public function setVotesAllowed(?bool $votesAllowed): self
{
$this->votesAllowed = $votesAllowed;
return $this;
}
public function getVotesMax()
{
return $this->votesMax;
}
public function setVotesMax($votesMax): self
{
$this->votesMax = $votesMax;
return $this;
}
public function getChoicesMax()
{
return $this->choicesMax;
}
public function setChoicesMax($choicesMax): self
{
$this->choicesMax = $choicesMax;
return $this;
}
public function getCommentsAllowed(): ?bool
{
return $this->commentsAllowed;
}
public function setCommentsAllowed(?bool $commentsAllowed): self
{
$this->commentsAllowed = $commentsAllowed;
return $this;
}
}