Skip to content

Commit

Permalink
Fixes #34 -- Expand long_url length for short URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
BusterNeece committed Jul 23, 2024
1 parent 11a7847 commit d4a389b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/templates/dashboard/short_urls/edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<label for="long_url" class="form-label">Original URL:</label>
<input type="text" name="long_url" id="long_url"
value="{{ row.long_url|default('')|e('html_attr') }}"
class="form-control form-control-lg" required maxlength="128">
class="form-control form-control-lg" required>
<p class="form-text">You can use a relative (i.e. <code>/dashboard</code>) or an absolute
(i.e. <code>https://example.com</code>) URL.</p>
</div>
Expand Down
23 changes: 23 additions & 0 deletions db/migrations/20240723081524_expand_short_url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Phinx\Db\Table\Column;
use Phinx\Migration\AbstractMigration;

final class ExpandShortUrl extends AbstractMigration
{
/**
* Expand short URL values
*/
public function change(): void
{
$this->table('web_short_urls')
->changeColumn(
'long_url',
(new Column())
->setType(Column::TEXT)
->setNull(true)
)->update();
}
}

0 comments on commit d4a389b

Please sign in to comment.