mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Increased long URL size in DB to 2048 characters
This commit is contained in:
37
data/migrations/Version20191020074522.php
Normal file
37
data/migrations/Version20191020074522.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace ShlinkMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Column;
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Schema\SchemaException;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20191020074522 extends AbstractMigration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws SchemaException
|
||||||
|
*/
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->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');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace <namespace>;
|
namespace <namespace>;
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
MYSQL_DATABASE: shlink
|
MYSQL_DATABASE: shlink
|
||||||
|
MYSQL_INITDB_SKIP_TZINFO: 1
|
||||||
|
|
||||||
shlink_redis:
|
shlink_redis:
|
||||||
container_name: shlink_redis
|
container_name: shlink_redis
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ $builder->createField('id', Type::BIGINT)
|
|||||||
|
|
||||||
$builder->createField('longUrl', Type::STRING)
|
$builder->createField('longUrl', Type::STRING)
|
||||||
->columnName('original_url')
|
->columnName('original_url')
|
||||||
->length(1024)
|
->length(2048)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
$builder->createField('shortCode', Type::STRING)
|
$builder->createField('shortCode', Type::STRING)
|
||||||
|
|||||||
Reference in New Issue
Block a user