allow 65535 character in meta fields (#2690)
This commit is contained in:
@@ -29,7 +29,6 @@ trait MetaTableTypeTrait
|
|||||||
* @ORM\Column(name="id", type="integer")
|
* @ORM\Column(name="id", type="integer")
|
||||||
*/
|
*/
|
||||||
private $id;
|
private $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the meta (custom) field
|
* Name of the meta (custom) field
|
||||||
*
|
*
|
||||||
@@ -43,7 +42,6 @@ trait MetaTableTypeTrait
|
|||||||
* @Assert\Length(min=2, max=50, allowEmptyString=false)
|
* @Assert\Length(min=2, max=50, allowEmptyString=false)
|
||||||
*/
|
*/
|
||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Value of the meta (custom) field
|
* Value of the meta (custom) field
|
||||||
*
|
*
|
||||||
@@ -52,10 +50,10 @@ trait MetaTableTypeTrait
|
|||||||
* @Serializer\Expose()
|
* @Serializer\Expose()
|
||||||
* @Serializer\Groups({"Default"})
|
* @Serializer\Groups({"Default"})
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="value", type="string", length=255, nullable=true)
|
* @ORM\Column(name="value", type="text", length=65535, nullable=true)
|
||||||
|
* @Assert\Length(max=65535, allowEmptyString=true)
|
||||||
*/
|
*/
|
||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*
|
*
|
||||||
|
|||||||
58
src/Migrations/Version20210727104955.php
Normal file
58
src/Migrations/Version20210727104955.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Kimai time-tracking app.
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Types\Type;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.15
|
||||||
|
*/
|
||||||
|
final class Version20210727104955 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Allows arbitrary length of meta columns';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$activitiesMeta = $schema->getTable('kimai2_activities_meta');
|
||||||
|
$activitiesMeta->getColumn('value')->setLength(65535)->setType(Type::getType(Types::TEXT));
|
||||||
|
|
||||||
|
$customersMeta = $schema->getTable('kimai2_customers_meta');
|
||||||
|
$customersMeta->getColumn('value')->setLength(65535)->setType(Type::getType(Types::TEXT));
|
||||||
|
|
||||||
|
$projectsMeta = $schema->getTable('kimai2_projects_meta');
|
||||||
|
$projectsMeta->getColumn('value')->setLength(65535)->setType(Type::getType(Types::TEXT));
|
||||||
|
|
||||||
|
$timesheetMeta = $schema->getTable('kimai2_timesheet_meta');
|
||||||
|
$timesheetMeta->getColumn('value')->setLength(65535)->setType(Type::getType(Types::TEXT));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$activitiesMeta = $schema->getTable('kimai2_activities_meta');
|
||||||
|
$activitiesMeta->getColumn('value')->setLength(255)->setType(Type::getType(Types::STRING));
|
||||||
|
|
||||||
|
$customersMeta = $schema->getTable('kimai2_customers_meta');
|
||||||
|
$customersMeta->getColumn('value')->setLength(255)->setType(Type::getType(Types::STRING));
|
||||||
|
|
||||||
|
$projectsMeta = $schema->getTable('kimai2_projects_meta');
|
||||||
|
$projectsMeta->getColumn('value')->setLength(255)->setType(Type::getType(Types::STRING));
|
||||||
|
|
||||||
|
$timesheetMeta = $schema->getTable('kimai2_timesheet_meta');
|
||||||
|
$timesheetMeta->getColumn('value')->setLength(255)->setType(Type::getType(Types::STRING));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user