mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added migration to make the combination of slug+domain unique
This commit is contained in:
@@ -28,7 +28,6 @@ $builder->createField('longUrl', Type::STRING)
|
||||
|
||||
$builder->createField('shortCode', Type::STRING)
|
||||
->columnName('short_code')
|
||||
->unique()
|
||||
->length(255)
|
||||
->build();
|
||||
|
||||
@@ -66,3 +65,5 @@ $builder->createManyToOne('domain', Entity\Domain::class)
|
||||
->addJoinColumn('domain_id', 'id', true, false, 'RESTRICT')
|
||||
->cascadePersist()
|
||||
->build();
|
||||
|
||||
$builder->addUniqueConstraint(['short_code', 'domain_id'], 'unique_short_code_plus_domain');
|
||||
|
||||
Reference in New Issue
Block a user