mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 08:23:11 -06:00
mediaapi/storage: StoreMediaMetadata error if origin and id not unique in db
This commit is contained in:
parent
2004dfcfcf
commit
2f6db5d317
|
|
@ -43,6 +43,7 @@ func Open(dataSourceName string) (*Database, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// StoreMediaMetadata inserts the metadata about the uploaded media into the database.
|
// StoreMediaMetadata inserts the metadata about the uploaded media into the database.
|
||||||
|
// Returns an error if the combination of MediaID and Origin are not unique in the table.
|
||||||
func (d *Database) StoreMediaMetadata(mediaMetadata *types.MediaMetadata) error {
|
func (d *Database) StoreMediaMetadata(mediaMetadata *types.MediaMetadata) error {
|
||||||
return d.statements.insertMedia(mediaMetadata)
|
return d.statements.insertMedia(mediaMetadata)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue