diff --git a/CHANGELOG.md b/CHANGELOG.md index cda60fac..84dfd5f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Fixed -* *Nothing* +* [#507](https://github.com/shlinkio/shlink/issues/507) Fixed error with too long original URLs by increasing size to the maximum value (2048) based on [the standard](https://stackoverflow.com/a/417184). ## 1.19.0 - 2019-10-05 diff --git a/composer.json b/composer.json index b7223999..838df503 100644 --- a/composer.json +++ b/composer.json @@ -60,8 +60,8 @@ "devster/ubench": "^2.0", "eaglewu/swoole-ide-helper": "dev-master", "filp/whoops": "^2.4", - "infection/infection": "^0.13.4", - "phpstan/phpstan": "^0.11.2", + "infection/infection": "^0.14.2", + "phpstan/phpstan": "^0.11.16", "phpunit/phpcov": "^6.0", "phpunit/phpunit": "^8.3", "roave/security-advisories": "dev-master", @@ -151,7 +151,6 @@ ] }, "scripts-descriptions": { - "check": "Alias for \"cs\", \"stan\", \"test\" and \"infect\"", "ci": "Alias for \"cs\", \"stan\", \"test:ci\" and \"infect:ci\"", "cs": "Checks coding styles", "cs:fix": "Fixes coding styles, when possible", diff --git a/data/migrations/Version20191020074522.php b/data/migrations/Version20191020074522.php new file mode 100644 index 00000000..baf1ce7a --- /dev/null +++ b/data/migrations/Version20191020074522.php @@ -0,0 +1,37 @@ +getOriginalUrlColumn($schema)->setLength(2048); + } + + /** + * @throws SchemaException + */ + public function down(Schema $schema): void + { + $this->getOriginalUrlColumn($schema)->setLength(1024); + } + + /** + * @throws SchemaException + */ + private function getOriginalUrlColumn(Schema $schema): Column + { + return $schema->getTable('short_urls')->getColumn('original_url'); + } +} diff --git a/data/migrations_template.txt b/data/migrations_template.txt index 2e3e1edb..c7b938f2 100644 --- a/data/migrations_template.txt +++ b/data/migrations_template.txt @@ -1,4 +1,5 @@ ; diff --git a/docker-compose.yml b/docker-compose.yml index 34b9c64e..630ab955 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,7 @@ services: environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: shlink + MYSQL_INITDB_SKIP_TZINFO: 1 shlink_redis: container_name: shlink_redis diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php index 8dd6dc49..76e5ae7b 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Entity.ShortUrl.php @@ -24,7 +24,7 @@ $builder->createField('id', Type::BIGINT) $builder->createField('longUrl', Type::STRING) ->columnName('original_url') - ->length(1024) + ->length(2048) ->build(); $builder->createField('shortCode', Type::STRING)