-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from acelaya/feature/delete-short-codes
Delete short URLs
- Loading branch information
Showing
46 changed files
with
1,171 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Shlinkio\Shlink; | ||
|
||
return [ | ||
|
||
'delete_short_urls' => [ | ||
'visits_threshold' => 15, | ||
'check_visits_threshold' => true, | ||
], | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace ShlinkMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Schema\SchemaException; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20180915110857 extends AbstractMigration | ||
{ | ||
private const ON_DELETE_MAP = [ | ||
'visit_locations' => 'SET NULL', | ||
'short_urls' => 'CASCADE', | ||
]; | ||
|
||
/** | ||
* @param Schema $schema | ||
* @throws SchemaException | ||
*/ | ||
public function up(Schema $schema): void | ||
{ | ||
$visits = $schema->getTable('visits'); | ||
$foreignKeys = $visits->getForeignKeys(); | ||
|
||
// Remove all existing foreign keys and add them again with CASCADE delete | ||
foreach ($foreignKeys as $foreignKey) { | ||
$visits->removeForeignKey($foreignKey->getName()); | ||
$foreignTable = $foreignKey->getForeignTableName(); | ||
|
||
$visits->addForeignKeyConstraint( | ||
$foreignTable, | ||
$foreignKey->getLocalColumns(), | ||
$foreignKey->getForeignColumns(), | ||
[ | ||
'onDelete' => self::ON_DELETE_MAP[$foreignTable], | ||
'onUpdate' => 'RESTRICT', | ||
] | ||
); | ||
} | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// Nothing to run | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Shlink 1.0\n" | ||
"POT-Creation-Date: 2018-08-04 16:35+0200\n" | ||
"PO-Revision-Date: 2018-08-04 16:37+0200\n" | ||
"POT-Creation-Date: 2018-09-15 17:57+0200\n" | ||
"PO-Revision-Date: 2018-09-15 18:02+0200\n" | ||
"Last-Translator: Alejandro Celaya <[email protected]>\n" | ||
"Language-Team: \n" | ||
"Language: es_ES\n" | ||
|
@@ -80,6 +80,41 @@ msgstr "" | |
msgid "Secret key: \"%s\"" | ||
msgstr "Clave secreta: \"%s\"" | ||
|
||
msgid "Deletes a short URL" | ||
msgstr "Elimina una URL" | ||
|
||
msgid "The short code to be deleted" | ||
msgstr "El código corto a eliminar" | ||
|
||
msgid "" | ||
"Ignores the safety visits threshold check, which could make short URLs with " | ||
"many visits to be accidentally deleted" | ||
msgstr "" | ||
"Ignora el límite de seguridad de visitas, pudiendo resultar en el borrado " | ||
"accidental de URLs con muchas visitas" | ||
|
||
#, php-format | ||
msgid "Provided short code \"%s\" could not be found." | ||
msgstr "El código corto proporcionado \"%s\" no ha podido ser encontrado." | ||
|
||
#, php-format | ||
msgid "" | ||
"It was not possible to delete the short URL with short code \"%s\" because " | ||
"it has more than %s visits." | ||
msgstr "" | ||
"No se pudo eliminar la URL acortada con código corto \"%s\" porque tiene más " | ||
"de %s visitas." | ||
|
||
msgid "Do you want to delete it anyway?" | ||
msgstr "¿Aún así quieres eliminarla?" | ||
|
||
msgid "Short URL was not deleted." | ||
msgstr "La URL corta no ha sido eliminada." | ||
|
||
#, php-format | ||
msgid "Short URL with short code \"%s\" successfully deleted." | ||
msgstr "La URL acortada con el código corto \"%s\" eliminada correctamente." | ||
|
||
msgid "" | ||
"Processes and generates the previews for every URL, improving performance " | ||
"for later web requests." | ||
|
@@ -183,12 +218,12 @@ msgstr "Origen" | |
msgid "Date" | ||
msgstr "Fecha" | ||
|
||
msgid "Remote Address" | ||
msgstr "Dirección remota" | ||
|
||
msgid "User agent" | ||
msgstr "Agente de usuario" | ||
|
||
msgid "Country" | ||
msgstr "País" | ||
|
||
msgid "List all short URLs" | ||
msgstr "Listar todas las URLs cortas" | ||
|
||
|
@@ -218,8 +253,11 @@ msgstr "Si se desea mostrar las etiquetas o no" | |
msgid "Short code" | ||
msgstr "Código corto" | ||
|
||
msgid "Original URL" | ||
msgstr "URL original" | ||
msgid "Short URL" | ||
msgstr "URL corta" | ||
|
||
msgid "Long URL" | ||
msgstr "URL larga" | ||
|
||
msgid "Date created" | ||
msgstr "Fecha de creación" | ||
|
@@ -253,10 +291,6 @@ msgstr "URL larga:" | |
msgid "Provided short code \"%s\" has an invalid format." | ||
msgstr "El código corto proporcionado \"%s\" tiene un formato inválido." | ||
|
||
#, php-format | ||
msgid "Provided short code \"%s\" could not be found." | ||
msgstr "El código corto proporcionado \"%s\" no ha podido ser encontrado." | ||
|
||
msgid "Creates one or more tags." | ||
msgstr "Crea una o más etiquetas." | ||
|
||
|
@@ -327,6 +361,12 @@ msgstr "Limite del localizador de IPs alcanzado. Esperando %s segundos..." | |
msgid "Finished processing all IPs" | ||
msgstr "Finalizado el procesado de todas las IPs" | ||
|
||
#~ msgid "Remote Address" | ||
#~ msgstr "Dirección remota" | ||
|
||
#~ msgid "Original URL" | ||
#~ msgstr "URL original" | ||
|
||
#~ msgid "You have reached last page" | ||
#~ msgstr "Has alcanzado la última página" | ||
|
||
|
Oops, something went wrong.