From 2926965400309ea76fa9e4b98311c56c33258528 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 17 Feb 2022 15:08:12 +0100 Subject: [PATCH] move residentialAddress entity to the ChillPerson bundle --- .../migrations/Version20220217133607.php | 38 +++++++++++++++++++ .../ResidentialAddressController.php | 6 +-- .../Entity/Person}/ResidentialAddress.php | 7 ++-- .../Form}/ResidentialAddressType.php | 6 ++- .../ResidentialAddressRepository.php | 4 +- 5 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/migrations/Version20220217133607.php rename src/Bundle/{ChillMainBundle/Entity => ChillPersonBundle/Entity/Person}/ResidentialAddress.php (94%) rename src/Bundle/{ChillMainBundle/Form/Type => ChillPersonBundle/Form}/ResidentialAddressType.php (91%) rename src/Bundle/{ChillMainBundle => ChillPersonBundle}/Repository/ResidentialAddressRepository.php (94%) diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php b/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php new file mode 100644 index 000000000..b2be09645 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php @@ -0,0 +1,38 @@ +addSql('ALTER TABLE IF EXISTS chill_main_residential_address RENAME TO chill_person_residential_address;'); + $this->addSql('ALTER SEQUENCE IF EXISTS chill_main_residential_address_id_seq RENAME TO chill_person_residential_address_id_seq;'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE IF EXISTS chill_person_residential_address RENAME TO chill_main_residential_address;'); + $this->addSql('ALTER SEQUENCE IF EXISTS chill_person_residential_address_id_seq RENAME TO chill_main_residential_address_id_seq;'); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php index 8b266208a..a2330bf88 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php @@ -11,9 +11,9 @@ declare(strict_types=1); namespace Chill\PersonBundle\Controller; -use Chill\MainBundle\Entity\ResidentialAddress; -use Chill\MainBundle\Form\Type\ResidentialAddressType; -use Chill\MainBundle\Repository\ResidentialAddressRepository; +use Chill\PersonBundle\Entity\Person\ResidentialAddress; +use Chill\PersonBundle\Form\Type\ResidentialAddressType; +use Chill\PersonBundle\Repository\ResidentialAddressRepository; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/Bundle/ChillMainBundle/Entity/ResidentialAddress.php b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php similarity index 94% rename from src/Bundle/ChillMainBundle/Entity/ResidentialAddress.php rename to src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php index 7763ea9d5..b2f10ac08 100644 --- a/src/Bundle/ChillMainBundle/Entity/ResidentialAddress.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php @@ -9,10 +9,11 @@ declare(strict_types=1); -namespace Chill\MainBundle\Entity; +namespace Chill\PersonBundle\Entity\Person; +use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; -use Chill\MainBundle\Repository\ResidentialAddressRepository; +use Chill\PersonBundle\Repository\ResidentialAddressRepository; use Chill\PersonBundle\Entity\Person; use Chill\ThirdPartyBundle\Entity\ThirdParty; use DateTimeImmutable; @@ -20,7 +21,7 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=ResidentialAddressRepository::class) - * @ORM\Table(name="chill_main_residential_address") + * @ORM\Table(name="chill_person_residential_address") */ class ResidentialAddress { diff --git a/src/Bundle/ChillMainBundle/Form/Type/ResidentialAddressType.php b/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php similarity index 91% rename from src/Bundle/ChillMainBundle/Form/Type/ResidentialAddressType.php rename to src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php index 0ebe47fef..e7577f336 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ResidentialAddressType.php +++ b/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php @@ -9,9 +9,11 @@ declare(strict_types=1); -namespace Chill\MainBundle\Form\Type; +namespace Chill\PersonBundle\Form\Type; -use Chill\MainBundle\Entity\ResidentialAddress; +use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PickAddressType; +use Chill\PersonBundle\Entity\Person\ResidentialAddress; use Chill\PersonBundle\Form\Type\PickPersonDynamicType; use Chill\ThirdPartyBundle\Form\Type\PickThirdpartyDynamicType; use Symfony\Component\Form\AbstractType; diff --git a/src/Bundle/ChillMainBundle/Repository/ResidentialAddressRepository.php b/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php similarity index 94% rename from src/Bundle/ChillMainBundle/Repository/ResidentialAddressRepository.php rename to src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php index 05cdfdf6c..fedbe8824 100644 --- a/src/Bundle/ChillMainBundle/Repository/ResidentialAddressRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php @@ -9,9 +9,9 @@ declare(strict_types=1); -namespace Chill\MainBundle\Repository; +namespace Chill\PersonBundle\Repository; -use Chill\MainBundle\Entity\ResidentialAddress; +use Chill\PersonBundle\Entity\Person\ResidentialAddress; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry;