forked from GNUsocial/gnu-social
[ENTITY] Add uniqueness constraint to Attachment::file_hash
This commit is contained in:
parent
4f936108a1
commit
3fab198c04
@ -213,18 +213,17 @@ class Attachment extends Entity
|
|||||||
return $this->height;
|
return $this->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setModified(\DateTimeInterface $modified): self
|
public function setModified(DateTimeInterface $modified): self
|
||||||
{
|
{
|
||||||
$this->modified = $modified;
|
$this->modified = $modified;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getModified(): \DateTimeInterface
|
public function getModified(): DateTimeInterface
|
||||||
{
|
{
|
||||||
return $this->modified;
|
return $this->modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// }}} Autocode
|
// }}} Autocode
|
||||||
|
|
||||||
const URLHASH_ALGO = 'sha256';
|
const URLHASH_ALGO = 'sha256';
|
||||||
@ -303,7 +302,7 @@ class Attachment extends Entity
|
|||||||
],
|
],
|
||||||
'primary key' => ['id'],
|
'primary key' => ['id'],
|
||||||
'unique keys' => [
|
'unique keys' => [
|
||||||
// 'file_file_key' => ['file_hash', 'actor_id'],
|
'attachment_file_hash_uniq' => ['file_hash'],
|
||||||
],
|
],
|
||||||
'indexes' => [
|
'indexes' => [
|
||||||
'file_filehash_idx' => ['file_hash'],
|
'file_filehash_idx' => ['file_hash'],
|
||||||
|
Loading…
Reference in New Issue
Block a user