mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
address: alter postalcode entity
This commit is contained in:
parent
ddbd6a9f23
commit
24320cb702
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Doctrine\Model\Point;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
@ -62,6 +63,30 @@ class PostalCode
|
||||
*/
|
||||
private $origin = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @groups({"write", "read"})
|
||||
*/
|
||||
private $refId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @groups({"write", "read"})
|
||||
*/
|
||||
private $source;
|
||||
|
||||
/**
|
||||
* @var Point
|
||||
*
|
||||
* @ORM\Column(type="point", nullable=true)
|
||||
* @groups({"write", "read"})
|
||||
*/
|
||||
private $center;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
@ -169,5 +194,41 @@ class PostalCode
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
public function getRefId(): ?string
|
||||
{
|
||||
return $this->refId;
|
||||
}
|
||||
|
||||
public function setRefId(?string $refId): self
|
||||
{
|
||||
$this->refId = $refId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSource(): ?string
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function setSource(?string $source): self
|
||||
{
|
||||
$this->source = $source;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCenter(): ?Point
|
||||
{
|
||||
return $this->center;
|
||||
}
|
||||
|
||||
public function setCenter(?Point $center): self
|
||||
{
|
||||
$this->center = $center;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add some fields to PostalCode
|
||||
*/
|
||||
final class Version20211006151653 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add some fields to PostalCode';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code ADD refId VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code ADD source VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code ADD center geometry(POINT,4326) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code DROP refId');
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code DROP source');
|
||||
$this->addSql('ALTER TABLE chill_main_postal_code DROP center');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user