mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Change long URL columns to TEXT type
This commit is contained in:
parent
145d4eaaed
commit
8f954151ca
4 changed files with 32 additions and 7 deletions
|
@ -25,17 +25,17 @@ return static function (ClassMetadata $metadata, array $emConfig): void {
|
|||
->unique()
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('baseUrlRedirect', Types::STRING), $emConfig)
|
||||
fieldWithUtf8Charset($builder->createField('baseUrlRedirect', Types::TEXT), $emConfig)
|
||||
->columnName('base_url_redirect')
|
||||
->nullable()
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('regular404Redirect', Types::STRING), $emConfig)
|
||||
fieldWithUtf8Charset($builder->createField('regular404Redirect', Types::TEXT), $emConfig)
|
||||
->columnName('regular_not_found_redirect')
|
||||
->nullable()
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('invalidShortUrlRedirect', Types::STRING), $emConfig)
|
||||
fieldWithUtf8Charset($builder->createField('invalidShortUrlRedirect', Types::TEXT), $emConfig)
|
||||
->columnName('invalid_short_url_redirect')
|
||||
->nullable()
|
||||
->build();
|
||||
|
|
|
@ -30,9 +30,8 @@ return static function (ClassMetadata $metadata, array $emConfig): void {
|
|||
->length(255)
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('longUrl', Types::STRING), $emConfig)
|
||||
fieldWithUtf8Charset($builder->createField('longUrl', Types::TEXT), $emConfig)
|
||||
->columnName('long_url')
|
||||
->length(2048)
|
||||
->build();
|
||||
|
||||
$builder->createManyToOne('shortUrl', ShortUrl\Entity\ShortUrl::class)
|
||||
|
|
|
@ -23,9 +23,8 @@ return static function (ClassMetadata $metadata, array $emConfig): void {
|
|||
->option('unsigned', true)
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('longUrl', Types::STRING), $emConfig)
|
||||
fieldWithUtf8Charset($builder->createField('longUrl', Types::TEXT), $emConfig)
|
||||
->columnName('original_url') // Rename to long_url some day? ¯\_(ツ)_/¯
|
||||
->length(2048)
|
||||
->build();
|
||||
|
||||
fieldWithUtf8Charset($builder->createField('shortCode', Types::STRING), $emConfig, 'bin')
|
||||
|
|
27
module/Core/migrations/Version20240220214031.php
Normal file
27
module/Core/migrations/Version20240220214031.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ShlinkMigrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240220214031 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function isTransactional(): bool
|
||||
{
|
||||
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue