From 2f6db5d317b34814b0ea3f009514707c996dcb8e Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Mon, 22 May 2017 15:11:28 +0200 Subject: [PATCH] mediaapi/storage: StoreMediaMetadata error if origin and id not unique in db --- src/github.com/matrix-org/dendrite/mediaapi/storage/storage.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/github.com/matrix-org/dendrite/mediaapi/storage/storage.go b/src/github.com/matrix-org/dendrite/mediaapi/storage/storage.go index 072ec4f8f..429af6d14 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/storage/storage.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/storage/storage.go @@ -43,6 +43,7 @@ func Open(dataSourceName string) (*Database, error) { } // 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 { return d.statements.insertMedia(mediaMetadata) }