mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
entities + migration created
This commit is contained in:
parent
7513187a6d
commit
7b4405f6fe
255
src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php
Normal file
255
src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php
Normal file
@ -0,0 +1,255 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Entity\Person;
|
||||
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTimeInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="chill_person_resource")
|
||||
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "personResource": personResource::class
|
||||
* })
|
||||
*/
|
||||
class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private ?int $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?Person $personOwner = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?ThirdParty $thirdParty = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $freeText;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=PersonResourceKind::class, inversedBy="personResources")
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $kind;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
private User $createdBy;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
private User $updatedBy;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->comment = new CommentEmbeddable();
|
||||
}
|
||||
|
||||
/**
|
||||
* GETTERS
|
||||
*/
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getFreeText(): ?string
|
||||
{
|
||||
return $this->freeText;
|
||||
}
|
||||
|
||||
public function getComment(): CommentEmbeddable
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function getKind(): ?PersonResourceKind
|
||||
{
|
||||
return $this->kind;
|
||||
}
|
||||
|
||||
public function getPersonOwner(): ?Person
|
||||
{
|
||||
return $this->personOwner;
|
||||
}
|
||||
|
||||
public function getPerson(): ?Person
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function getThirdParty(): ?ThirdParty
|
||||
{
|
||||
return $this->thirdParty;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?DateTimeInterface
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function getCreatedBy(): ?User
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
||||
public function getUpdatedAt(): ?DateTimeInterface
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function getUpdatedBy(): ?User
|
||||
{
|
||||
return $this->updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* SETTERS
|
||||
*/
|
||||
|
||||
public function setFreeText(?string $freeText): self
|
||||
{
|
||||
$this->freeText = $freeText;
|
||||
|
||||
if ('' !== $freeText) {
|
||||
$this->setPerson(null);
|
||||
$this->setThirdParty(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setComment(CommentEmbeddable $comment): self
|
||||
{
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setKind(?PersonResourceKind $kind): self
|
||||
{
|
||||
$this->kind = $kind;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPersonOwner(?Person $personOwner): self
|
||||
{
|
||||
$this->personOwner = $personOwner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPerson(?Person $person): self
|
||||
{
|
||||
$this->person = $person;
|
||||
|
||||
if (null !== $person) {
|
||||
$this->setFreeText("");
|
||||
$this->setThirdParty(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setThirdParty(?ThirdParty $thirdParty): self
|
||||
{
|
||||
$this->thirdParty = $thirdParty;
|
||||
|
||||
if (null !== $thirdParty) {
|
||||
$this->setFreeText("");
|
||||
$this->setPerson(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedAt(DateTimeInterface $createdAt): self
|
||||
{
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedBy(?User $createdBy): self
|
||||
{
|
||||
$this->createdBy = $createdBy;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(DateTimeInterface $updatedAt): self
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedBy(?User $updatedBy): self
|
||||
{
|
||||
$this->updatedBy = $updatedBy;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Entity\Person;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* **About denormalization**: this operation is operated by @see{AccompanyingPeriodResourdeNormalizer}.
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="chill_person_resource_kind")
|
||||
*/
|
||||
class PersonResourceKind
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private int $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", length=255)
|
||||
*/
|
||||
private array $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
private bool $isActive = true;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getIsActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
||||
public function getLabel(): ?array
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(array $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIsActive(bool $isActive): self
|
||||
{
|
||||
$this->isActive = $isActive;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Person;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Creation of PersonResource and PersonResourceKind
|
||||
*/
|
||||
final class Version20220118100237 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Creation of PersonResource and PersonResourceKind';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
// $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_eval_doc_id_seq CASCADE');
|
||||
$this->addSql('CREATE SEQUENCE chill_person_resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE chill_person_resource_kind_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE TABLE chill_person_resource (id INT NOT NULL, person_id INT DEFAULT NULL, kind_id INT DEFAULT NULL, freeText TEXT DEFAULT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, comment_comment TEXT DEFAULT NULL, comment_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, comment_userId INT DEFAULT NULL, personOwner_id INT NOT NULL, thirdParty_id INT DEFAULT NULL, createdBy_id INT NOT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D92D19C515B ON chill_person_resource (personOwner_id)');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D92217BBB47 ON chill_person_resource (person_id)');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D923EA5CAB0 ON chill_person_resource (thirdParty_id)');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D9230602CA9 ON chill_person_resource (kind_id)');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D923174800F ON chill_person_resource (createdBy_id)');
|
||||
$this->addSql('CREATE INDEX IDX_FA5B7D9265FF1AEC ON chill_person_resource (updatedBy_id)');
|
||||
$this->addSql('CREATE TABLE chill_person_resource_kind (id INT NOT NULL, label JSON NOT NULL, isActive BOOLEAN NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D92D19C515B FOREIGN KEY (personOwner_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D92217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D923EA5CAB0 FOREIGN KEY (thirdParty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D9230602CA9 FOREIGN KEY (kind_id) REFERENCES chill_person_resource_kind (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D923174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_resource ADD CONSTRAINT FK_FA5B7D9265FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('DROP TABLE chill_main_address_legacy');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095a550b0c53 RENAME TO IDX_AC74095AD7FA8EF0');
|
||||
// $this->addSql('ALTER INDEX idx_55026b0cc54c8c93 RENAME TO IDX_AC74095AC54C8C93');
|
||||
// $this->addSql('ALTER INDEX idx_55026b0c217bbb47 RENAME TO IDX_AC74095A217BBB47');
|
||||
// $this->addSql('ALTER INDEX idx_55026b0c682b5931 RENAME TO IDX_AC74095A682B5931');
|
||||
// $this->addSql('ALTER INDEX idx_55026b0ca76ed395 RENAME TO IDX_AC74095AA76ED395');
|
||||
// $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL');
|
||||
// $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2');
|
||||
// $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL');
|
||||
// $this->addSql('DROP INDEX internal_center_geom_idx');
|
||||
// $this->addSql('DROP INDEX chill_custom_main_address_filtering_idx');
|
||||
// $this->addSql('ALTER TABLE chill_main_address DROP customs');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER isnoaddress DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE geometry(POINT,4326)');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT');
|
||||
// $this->addSql('DROP INDEX chill_internal_address_reference_canonicalized');
|
||||
// $this->addSql('DROP INDEX address_refid');
|
||||
// $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE geometry(POINT,4326)');
|
||||
// $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT');
|
||||
// $this->addSql('CREATE INDEX address_refid ON chill_main_address_reference (refId) WHERE refid != \'\'');
|
||||
// $this->addSql('ALTER TABLE chill_main_location ALTER active DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER active DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER editablebyusers DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER editablebyusers SET NOT NULL');
|
||||
// $this->addSql('ALTER INDEX idx_154a075fef1a9d84 RENAME TO IDX_589D51B4EF1A9D84');
|
||||
// $this->addSql('ALTER INDEX idx_154a075fa76ed395 RENAME TO IDX_589D51B4A76ED395');
|
||||
// $this->addSql('DROP INDEX chill_internal_postal_code_canonicalized');
|
||||
// $this->addSql('ALTER TABLE chill_main_postal_code ALTER center TYPE geometry(POINT,4326)');
|
||||
// $this->addSql('ALTER TABLE chill_main_postal_code ALTER center DROP DEFAULT');
|
||||
// $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code (code, label)');
|
||||
// $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D');
|
||||
// $this->addSql('DROP INDEX participations_no_overlap');
|
||||
// $this->addSql('DROP INDEX thirdparty_unique');
|
||||
// $this->addSql('DROP INDEX person_unique');
|
||||
// $this->addSql('CREATE UNIQUE INDEX thirdparty_unique ON chill_person_accompanying_period_resource (thirdparty_id, accompanyingperiod_id)');
|
||||
// $this->addSql('CREATE UNIQUE INDEX person_unique ON chill_person_accompanying_period_resource (person_id, accompanyingperiod_id)');
|
||||
// $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT fk_b694fb3616d9d9b');
|
||||
// $this->addSql('DROP INDEX idx_b694fb3616d9d9b');
|
||||
// $this->addSql('ALTER TABLE chill_person_household DROP CONSTRAINT fk_household_comment_embeddable_user');
|
||||
// $this->addSql('DROP INDEX IDX_BE50A270116F5FA9');
|
||||
// $this->addSql('DROP INDEX household_members_not_overlaps');
|
||||
// $this->addSql('DROP INDEX chill_custom_person_household_members_sharing_idx');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER enddate DROP DEFAULT');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\'');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\'');
|
||||
// $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)');
|
||||
// $this->addSql('DROP INDEX mobilenumber_trgm_idx');
|
||||
// $this->addSql('DROP INDEX fullnamecanonical_trgm_idx');
|
||||
// $this->addSql('DROP INDEX chill_custom_fullnamecanonical_only_trgm_idx_gin');
|
||||
// $this->addSql('DROP INDEX phonenumber_trgm_idx');
|
||||
// $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER phonenumber DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER cfdata SET NOT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber DROP DEFAULT');
|
||||
// $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377');
|
||||
// $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5');
|
||||
// $this->addSql('ALTER INDEX idx_bf210a145521be40 RENAME TO IDX_BF210A14D7D03CE3');
|
||||
// $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F217BBB47');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT FK_7201106F82F1BAF4');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT FK_7201106F82F1BAF4 FOREIGN KEY (language_id) REFERENCES language (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER TABLE chill_person_relations ALTER isactive DROP NOT NULL');
|
||||
// $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE customfield ALTER required DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL');
|
||||
// $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B');
|
||||
// $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66');
|
||||
// $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET NOT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.geographical_unit_association ADD CONSTRAINT FK_981D5C95D58FA2A4 FOREIGN KEY (geographicalUnit_id) REFERENCES chill_vendee.geographical_unit (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.geographical_unit_association ADD CONSTRAINT FK_981D5C95A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10');
|
||||
// $this->addSql('ALTER TABLE permission_groups ALTER flags DROP DEFAULT');
|
||||
// $this->addSql('DROP INDEX "primary"');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_jobs ADD PRIMARY KEY (profile_id, job_id)');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_action ALTER profile_id DROP NOT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_action ALTER action SET NOT NULL');
|
||||
// $this->addSql('DROP INDEX chill_custom_canonicalized_trgm_idx_gist');
|
||||
// $this->addSql('DROP INDEX uniq_93f763ae217bbb47');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendee_person ALTER situationprofessionellestartdate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendee_person ALTER situationprofessionellestartdate DROP DEFAULT');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_vendee.vendee_person.situationProfessionelleStartDate IS \'(DC2Type:date_immutable)\'');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage ADD CONSTRAINT FK_4D319FFEF57537C3 FOREIGN KEY (vendeeperson_id) REFERENCES chill_vendee.vendee_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER INDEX chill_vendee.idx_1a4b602deef79338 RENAME TO IDX_DD0A4C00EEF79338');
|
||||
}
|
||||
|
||||
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 chill_person_resource DROP CONSTRAINT FK_FA5B7D9230602CA9');
|
||||
$this->addSql('DROP SEQUENCE chill_person_resource_id_seq CASCADE');
|
||||
$this->addSql('DROP SEQUENCE chill_person_resource_kind_id_seq CASCADE');
|
||||
// $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_eval_doc_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
// $this->addSql('CREATE TABLE chill_main_address_legacy (id INT DEFAULT NULL, postcode_id INT DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, streetnumber VARCHAR(255) DEFAULT NULL, validfrom DATE DEFAULT NULL, isnoaddress BOOLEAN DEFAULT NULL, customs JSONB DEFAULT NULL, floor VARCHAR(16) DEFAULT NULL, corridor VARCHAR(16) DEFAULT NULL, steps VARCHAR(16) DEFAULT NULL, buildingname VARCHAR(255) DEFAULT NULL, flat VARCHAR(16) DEFAULT NULL, distribution VARCHAR(255) DEFAULT NULL, extra VARCHAR(255) DEFAULT NULL, validto DATE DEFAULT NULL, point VARCHAR(255) DEFAULT NULL, linkedtothirdparty_id INT DEFAULT NULL)');
|
||||
$this->addSql('DROP TABLE chill_person_resource');
|
||||
$this->addSql('DROP TABLE chill_person_resource_kind');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER active SET DEFAULT \'true\'');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER editableByUsers SET DEFAULT \'true\'');
|
||||
// $this->addSql('ALTER TABLE chill_main_location_type ALTER editableByUsers DROP NOT NULL');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f217bbb47');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages DROP CONSTRAINT fk_7201106f82f1baf4');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER TABLE persons_spoken_languages ADD CONSTRAINT fk_7201106f82f1baf4 FOREIGN KEY (language_id) REFERENCES language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER INDEX idx_589d51b4ef1a9d84 RENAME TO idx_154a075fef1a9d84');
|
||||
// $this->addSql('ALTER INDEX idx_589d51b4a76ed395 RENAME TO idx_154a075fa76ed395');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendee_person ALTER situationProfessionelleStartDate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendee_person ALTER situationProfessionelleStartDate DROP DEFAULT');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_vendee.vendee_person.situationprofessionellestartdate IS NULL');
|
||||
// $this->addSql('CREATE UNIQUE INDEX uniq_93f763ae217bbb47 ON chill_vendee.vendee_person (person_id)');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.geographical_unit_association DROP CONSTRAINT FK_981D5C95D58FA2A4');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.geographical_unit_association DROP CONSTRAINT FK_981D5C95A76ED395');
|
||||
// $this->addSql('DROP INDEX person_unique');
|
||||
// $this->addSql('DROP INDEX thirdparty_unique');
|
||||
// $this->addSql('CREATE UNIQUE INDEX person_unique ON chill_person_accompanying_period_resource (person_id, accompanyingperiod_id) WHERE (person_id IS NOT NULL)');
|
||||
// $this->addSql('CREATE UNIQUE INDEX thirdparty_unique ON chill_person_accompanying_period_resource (thirdparty_id, accompanyingperiod_id) WHERE (thirdparty_id IS NOT NULL)');
|
||||
// $this->addSql('CREATE INDEX participations_no_overlap ON chill_person_accompanying_period_participation (person_id, accompanyingperiod_id)');
|
||||
// $this->addSql('ALTER TABLE chill_main_location ALTER active SET DEFAULT \'true\'');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095aa76ed395 RENAME TO idx_55026b0ca76ed395');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095a682b5931 RENAME TO idx_55026b0c682b5931');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095a217bbb47 RENAME TO idx_55026b0c217bbb47');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93');
|
||||
// $this->addSql('ALTER INDEX idx_ac74095ad7fa8ef0 RENAME TO IDX_AC74095A550B0C53');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber SET DEFAULT \'\'');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER phonenumber SET DEFAULT \'\'');
|
||||
// $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\'');
|
||||
// $this->addSql('CREATE INDEX mobilenumber_trgm_idx ON chill_person_person (mobilenumber)');
|
||||
// $this->addSql('CREATE INDEX fullnamecanonical_trgm_idx ON chill_person_person (center_id, fullnamecanonical)');
|
||||
// $this->addSql('CREATE INDEX chill_custom_fullnamecanonical_only_trgm_idx_gin ON chill_person_person (fullnamecanonical)');
|
||||
// $this->addSql('CREATE INDEX phonenumber_trgm_idx ON chill_person_person (phonenumber)');
|
||||
// $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55');
|
||||
// $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5');
|
||||
// $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center');
|
||||
// $this->addSql('ALTER INDEX idx_bf210a14d7d03ce3 RENAME TO IDX_BF210A145521BE40');
|
||||
// $this->addSql('ALTER TABLE chill_person_household ADD CONSTRAINT fk_household_comment_embeddable_user FOREIGN KEY (comment_members_userid) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('CREATE INDEX IDX_BE50A270116F5FA9 ON chill_person_household (comment_members_userid)');
|
||||
// $this->addSql('CREATE INDEX idx_b694fb3616d9d9b ON chill_person_accompanying_period_work (handlingthierparty_id)');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ADD customs JSONB DEFAULT \'[]\'');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER isNoAddress SET DEFAULT \'false\'');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER point TYPE VARCHAR(255)');
|
||||
// $this->addSql('ALTER TABLE chill_main_address ALTER point DROP DEFAULT');
|
||||
// $this->addSql('CREATE INDEX chill_custom_main_address_filtering_idx ON chill_main_address (id, validfrom, validto)');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.vendeeperson_entourage DROP CONSTRAINT FK_4D319FFEF57537C3');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate DROP DEFAULT');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate TYPE DATE');
|
||||
// $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate DROP DEFAULT');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_person_household_members.enddate IS NULL');
|
||||
// $this->addSql('COMMENT ON COLUMN chill_person_household_members.startdate IS NULL');
|
||||
// $this->addSql('CREATE INDEX household_members_not_overlaps ON chill_person_household_members (person_id) WHERE (sharedhousehold IS TRUE)');
|
||||
// $this->addSql('CREATE INDEX chill_custom_person_household_members_sharing_idx ON chill_person_household_members (person_id, startdate, enddate, household_id) WHERE (sharedhousehold IS TRUE)');
|
||||
// $this->addSql('ALTER INDEX chill_vendee.idx_dd0a4c00eef79338 RENAME TO idx_1a4b602deef79338');
|
||||
// $this->addSql('CREATE INDEX chill_custom_canonicalized_trgm_idx_gist ON chill_3party.third_party (canonicalized) WHERE (active IS TRUE)');
|
||||
// $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b');
|
||||
// $this->addSql('DROP INDEX address_refid');
|
||||
// $this->addSql('ALTER TABLE chill_main_address_reference ALTER point TYPE VARCHAR(255)');
|
||||
// $this->addSql('ALTER TABLE chill_main_address_reference ALTER point DROP DEFAULT');
|
||||
// $this->addSql('CREATE INDEX chill_internal_address_reference_canonicalized ON chill_main_address_reference (postcode_id, addresscanonical)');
|
||||
// $this->addSql('CREATE INDEX address_refid ON chill_main_address_reference (refid) WHERE ((refid)::text <> \'\'::text)');
|
||||
// $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_action ALTER profile_id SET NOT NULL');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_action ALTER action DROP NOT NULL');
|
||||
// $this->addSql('DROP INDEX security_profile_jobs_pkey');
|
||||
// $this->addSql('ALTER TABLE chill_vendee.security_profile_jobs ADD PRIMARY KEY (job_id, profile_id)');
|
||||
// $this->addSql('CREATE INDEX internal_center_geom_idx ON chill_vendee.center_polygon (geom)');
|
||||
// $this->addSql('DROP INDEX search_name_code');
|
||||
// $this->addSql('ALTER TABLE chill_main_postal_code ALTER center TYPE VARCHAR(255)');
|
||||
// $this->addSql('ALTER TABLE chill_main_postal_code ALTER center DROP DEFAULT');
|
||||
// $this->addSql('CREATE INDEX chill_internal_postal_code_canonicalized ON chill_main_postal_code (canonical) WHERE (origin = 0)');
|
||||
// $this->addSql('ALTER TABLE permission_groups ALTER flags SET DEFAULT \'[]\'');
|
||||
// $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)');
|
||||
// $this->addSql('ALTER TABLE chill_person_relations ALTER isActive SET NOT NULL');
|
||||
// $this->addSql('ALTER TABLE custom_field_long_choice_options ALTER internal_key SET DEFAULT \'\'');
|
||||
// $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66');
|
||||
// $this->addSql('ALTER TABLE customfield ALTER required SET DEFAULT \'false\'');
|
||||
// $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL');
|
||||
// $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b');
|
||||
// $this->addSql('ALTER TABLE customfieldsgroup ALTER options SET DEFAULT \'{}\'');
|
||||
// $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL');
|
||||
// $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL');
|
||||
// $this->addSql('ALTER INDEX idx_af82522312469de2 RENAME TO idx_654a2fcd12469de2');
|
||||
// $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user