Skip to content

Commit

Permalink
Fix: Increase url length in database to 2048 characters
Browse files Browse the repository at this point in the history
fix #1
  • Loading branch information
Torben Ewert committed Sep 5, 2019
1 parent 53fda00 commit f949759
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Domain/Model/ResultItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Neos\Flow\Annotations as Flow;
use Unikka\LinkChecker\Service\UriService;
use Psr\Http\Message\UriInterface;
use Doctrine\ORM\Mapping as ORM;

/**
* Model ResultItem
Expand All @@ -36,12 +37,14 @@ class ResultItem

/**
* @var string
* @ORM\Column(length=2048)
*/
protected $originUrl = '';

/**
* @var string
* @Flow\Validate(type="NotEmpty")
* @ORM\Column(length=2048)
*/
protected $url = '';

Expand Down
44 changes: 44 additions & 0 deletions Migrations/Mysql/Version20190905141704.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used.
*/
class Version20190905141704 extends AbstractMigration
{

/**
* @return string
*/
public function getDescription()
{
return '';
}

/**
* @param Schema $schema
* @return void
*/
public function up(Schema $schema)
{
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

$this->addSql('CREATE TABLE unikka_linkchecker_domain_model_resultitem (persistence_object_identifier VARCHAR(40) NOT NULL, createdat DATETIME NOT NULL, checkedat DATETIME NOT NULL, originurl VARCHAR(2048) NOT NULL, url VARCHAR(2048) NOT NULL, statuscode INT NOT NULL, PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
}

/**
* @param Schema $schema
* @return void
*/
public function down(Schema $schema)
{
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

$this->addSql('DROP TABLE unikka_linkchecker_domain_model_resultitem');
}
}

0 comments on commit f949759

Please sign in to comment.