Add missing fields & migrations

This commit is contained in:
Jean-Francois Monfort 2021-04-22 15:33:13 +02:00
parent 05ebdefd47
commit 31e8dea965
3 changed files with 19 additions and 19 deletions

View File

@ -74,9 +74,9 @@ class Activity implements HasCenterInterface, HasScopeInterface
private \DateTime $durationTime; private \DateTime $durationTime;
/** /**
* @ORM\Column(type="time") * @ORM\Column(type="time", nullable=true)
*/ */
private \DateTime $travelTime; private ?\DateTime $travelTime;
/** /**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence") * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
@ -111,22 +111,22 @@ class Activity implements HasCenterInterface, HasScopeInterface
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person") * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
*/ */
private ArrayCollection $persons; private Collection $persons;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
*/ */
private ArrayCollection $thirdParties; private Collection $thirdParties;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\Document") * @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\Document")
*/ */
private ArrayCollection $documents; private Collection $documents;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User") * @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
*/ */
private ArrayCollection $users; private Collection $users;
/** /**
* @ORM\Column(type="boolean", options={"default"=false}) * @ORM\Column(type="boolean", options={"default"=false})
@ -252,7 +252,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
/** /**
* Get reasons * Get reasons
*/ */
public function getReasons(): ArrayCollection public function getReasons(): Collection
{ {
return $this->reasons; return $this->reasons;
} }
@ -347,12 +347,12 @@ class Activity implements HasCenterInterface, HasScopeInterface
$this->persons->removeElement($person); $this->persons->removeElement($person);
} }
public function getPersons(): ArrayCollection public function getPersons(): Collection
{ {
return $this->persons; return $this->persons;
} }
public function setPersons(ArrayCollection $persons): self public function setPersons(Collection $persons): self
{ {
$this->persons = $persons; $this->persons = $persons;
@ -371,12 +371,12 @@ class Activity implements HasCenterInterface, HasScopeInterface
$this->thirdParties->removeElement($thirdParty); $this->thirdParties->removeElement($thirdParty);
} }
public function getThirdParties(): ArrayCollection public function getThirdParties(): Collection
{ {
return $this->thirdParties; return $this->thirdParties;
} }
public function setThirdParties(ArrayCollection $thirdParties): self public function setThirdParties(Collection $thirdParties): self
{ {
$this->thirdParties = $thirdParties; $this->thirdParties = $thirdParties;
@ -395,12 +395,12 @@ class Activity implements HasCenterInterface, HasScopeInterface
$this->documents->removeElement($document); $this->documents->removeElement($document);
} }
public function getDocuments(): ArrayCollection public function getDocuments(): Collection
{ {
return $this->documents; return $this->documents;
} }
public function setDocuments(ArrayCollection $documents): self public function setDocuments(Collection $documents): self
{ {
$this->documents = $documents; $this->documents = $documents;
@ -419,12 +419,12 @@ class Activity implements HasCenterInterface, HasScopeInterface
$this->users->removeElement($user); $this->users->removeElement($user);
} }
public function getUsers(): ArrayCollection public function getUsers(): Collection
{ {
return $this->users; return $this->users;
} }
public function setUsers(ArrayCollection $users): self public function setUsers(Collection $users): self
{ {
$this->users = $users; $this->users = $users;

View File

@ -45,7 +45,7 @@ class ActivityTypeType extends AbstractType
'persons', 'user', 'date', 'place', 'persons', 'persons', 'user', 'date', 'place', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee', 'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents', 'reasons', 'comment', 'sentReceived', 'documents',
'emergency', 'accompanyingPeriod', 'socialData' 'emergency', 'accompanyingPeriod', 'socialData', 'users'
]; ];
foreach ($fields as $field) { foreach ($fields as $field) {
$builder $builder

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Application\Migrations; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
@ -36,11 +36,11 @@ final class Version20210422123846 extends AbstractMigration
$this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE0381C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE0381C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE03C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE03C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A7881C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A7881C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); #$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDB81C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDB81C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDBA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDBA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE activity ADD travelTime TIME(0) WITHOUT TIME ZONE NOT NULL'); $this->addSql('ALTER TABLE activity ADD travelTime TIME(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE activitytype ADD travelTimeVisible SMALLINT DEFAULT 1 NOT NULL'); $this->addSql('ALTER TABLE activitytype ADD travelTimeVisible SMALLINT DEFAULT 1 NOT NULL');
$this->addSql('ALTER TABLE activitytype ADD travelTimeLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); $this->addSql('ALTER TABLE activitytype ADD travelTimeLabel VARCHAR(255) DEFAULT \'\' NOT NULL');