diff --git a/CHANGELOG.md b/CHANGELOG.md index d6215679..b5c7123b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * [#225](https://github.com/shlinkio/shlink/issues/225) Performance and maintainability slightly improved by enforcing via code sniffer that all global namespace classes, functions and constants are explicitly imported. * [#196](https://github.com/shlinkio/shlink/issues/196) Reduced anemic model in entities, defining more expressive public APIs instead. * [#249](https://github.com/shlinkio/shlink/issues/249) Added [functional-php](https://github.com/lstrojny/functional-php) to ease collections handling. +* [#253](https://github.com/shlinkio/shlink/issues/253) Increased `user_agent` column length in `visits` table to 512. #### Deprecated diff --git a/data/migrations/Version20181110175521.php b/data/migrations/Version20181110175521.php new file mode 100644 index 00000000..48e26f9e --- /dev/null +++ b/data/migrations/Version20181110175521.php @@ -0,0 +1,36 @@ +getUserAgentColumn($schema)->setLength(512); + } + + /** + * @throws SchemaException + */ + public function down(Schema $schema): void + { + $this->getUserAgentColumn($schema)->setLength(256); + } + + /** + * @throws SchemaException + */ + private function getUserAgentColumn(Schema $schema): Column + { + return $schema->getTable('visits')->getColumn('user_agent'); + } +} diff --git a/data/migrations_template.txt b/data/migrations_template.txt index 41c4a8c8..2e3e1edb 100644 --- a/data/migrations_template.txt +++ b/data/migrations_template.txt @@ -6,9 +6,6 @@ namespace ; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; -/** - * Auto-generated Migration: Please modify to your needs! - */ final class Version extends AbstractMigration { public function up(Schema $schema): void diff --git a/module/Core/src/Entity/Visit.php b/module/Core/src/Entity/Visit.php index d88448e1..54926e9e 100644 --- a/module/Core/src/Entity/Visit.php +++ b/module/Core/src/Entity/Visit.php @@ -39,7 +39,7 @@ class Visit extends AbstractEntity implements JsonSerializable private $remoteAddr; /** * @var string - * @ORM\Column(type="string", length=256, name="user_agent", nullable=true) + * @ORM\Column(type="string", length=512, name="user_agent", nullable=true) */ private $userAgent; /**