Increase DB field length for URLs to 2048 chars

This fixes issue #1122
This commit is contained in:
Jan Böhmer 2025-12-04 23:04:32 +01:00
parent a3d6f77fda
commit a5275f7be7
4 changed files with 166 additions and 9 deletions

View file

@ -166,9 +166,10 @@ abstract class Attachment extends AbstractNamedDBElement
* @var string|null The path to the external source if the file is stored externally or was downloaded from an
* external source. Null if there is no external source.
*/
#[ORM\Column(type: Types::STRING, nullable: true)]
#[ORM\Column(type: Types::STRING, length: 2048, nullable: true)]
#[Groups(['attachment:read'])]
#[ApiProperty(example: 'http://example.com/image.jpg')]
#[Assert\Length(2048)]
protected ?string $external_path = null;
/**
@ -551,8 +552,8 @@ abstract class Attachment extends AbstractNamedDBElement
*/
#[Groups(['attachment:write'])]
#[SerializedName('url')]
#[ApiProperty(description: 'Set the path of the attachment here.
Provide either an external URL, a path to a builtin file (like %FOOTPRINTS%/Active/ICs/IC_DFS.png) or an empty
#[ApiProperty(description: 'Set the path of the attachment here.
Provide either an external URL, a path to a builtin file (like %FOOTPRINTS%/Active/ICs/IC_DFS.png) or an empty
string if the attachment has an internal file associated and you\'d like to reset the external source.
If you set a new (nonempty) file path any associated internal file will be removed!')]
public function setURL(?string $url): self

View file

@ -83,8 +83,8 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
*/
#[Assert\Url(requireTld: false)]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
#[ORM\Column(type: Types::STRING, length: 2048)]
#[Assert\Length(max: 2048)]
protected string $website = '';
#[Groups(['company:read', 'company:write', 'import', 'full', 'extended'])]
@ -93,8 +93,8 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/**
* @var string The link to the website of an article. Use %PARTNUMBER% as placeholder for the part number.
*/
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
#[ORM\Column(type: Types::STRING, length: 2048)]
#[Assert\Length(max: 2048)]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
protected string $auto_product_url = '';

View file

@ -50,7 +50,7 @@ class InfoProviderReference
/**
* @var string|null The url of this part inside the provider system or null if this info is not existing
*/
#[Column(type: Types::STRING, nullable: true)]
#[Column(type: Types::STRING, length: 2048, nullable: true)]
#[Groups(['provider_reference:read', 'full'])]
private ?string $provider_url = null;
@ -157,4 +157,4 @@ class InfoProviderReference
$ref->last_updated = new \DateTimeImmutable();
return $ref;
}
}
}