Fix nullability on expanded Listener data.
This commit is contained in:
parent
d2ffb34388
commit
f1917386f3
|
@ -21,10 +21,10 @@ class ListenerDevice implements \JsonSerializable
|
|||
#[ORM\Column]
|
||||
protected bool $is_bot = false;
|
||||
|
||||
#[ORM\Column(length: 150)]
|
||||
#[ORM\Column(length: 150, nullable: true)]
|
||||
protected ?string $browser_family = null;
|
||||
|
||||
#[ORM\Column(length: 150)]
|
||||
#[ORM\Column(length: 150, nullable: true)]
|
||||
protected ?string $os_family = null;
|
||||
|
||||
public function getClient(): ?string
|
||||
|
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
#[ORM\Embeddable]
|
||||
class ListenerLocation implements \JsonSerializable
|
||||
{
|
||||
#[ORM\Column(length: 255)]
|
||||
protected string $description;
|
||||
#[ORM\Column(length: 255, nullable: false)]
|
||||
protected ?string $description = 'Unknown';
|
||||
|
||||
#[ORM\Column(length: 150, nullable: true)]
|
||||
protected ?string $region = null;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity\Migration;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220421123900 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Fix nullability of extended Listener columns.';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE listener CHANGE device_browser_family device_browser_family VARCHAR(150) DEFAULT NULL, CHANGE device_os_family device_os_family VARCHAR(150) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE listener CHANGE device_browser_family device_browser_family VARCHAR(150) NOT NULL, CHANGE device_os_family device_os_family VARCHAR(150) NOT NULL');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue