mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
FEATURE [profession] change field type of profession into string
This commit is contained in:
parent
c953da3fd0
commit
ac4c821290
@ -250,14 +250,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* [fr] Qualité.
|
* [fr] Qualité.
|
||||||
*
|
* @ORM\Column(name="profession", type="string", length=255, nullable=false)
|
||||||
* @var ThirdPartyProfession
|
|
||||||
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession")
|
|
||||||
* ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true)
|
|
||||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||||
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
|
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
|
||||||
*/
|
*/
|
||||||
private ?ThirdPartyProfession $profession = null;
|
private string $profession = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(name="telephone", type="phone_number", nullable=true)
|
* @ORM\Column(name="telephone", type="phone_number", nullable=true)
|
||||||
@ -491,9 +488,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ThirdPartyProfession
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getProfession(): ?ThirdPartyProfession
|
public function getProfession(): string
|
||||||
{
|
{
|
||||||
return $this->profession;
|
return $this->profession;
|
||||||
}
|
}
|
||||||
@ -811,7 +808,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setProfession(?ThirdPartyProfession $profession): ThirdParty
|
public function setProfession(string $profession): self
|
||||||
{
|
{
|
||||||
$this->profession = $profession;
|
$this->profession = $profession;
|
||||||
|
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\Migrations\ThirdParty;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20230215175150 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Change profession to a string field and transfer values';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_3party.third_party ADD profession VARCHAR(255) DEFAULT \'\' NOT NULL');
|
||||||
|
|
||||||
|
// $this->addSql('ALTER TABLE chill_3party.third_party DROP profession_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// $this->addSql('ALTER TABLE chill_3party.third_party ADD profession_id INT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_3party.third_party DROP profession');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user