Note for future unique constraint on image_fingerprint added

This commit is contained in:
Christoph Haas 2015-04-27 00:54:02 +02:00
parent 19e51445fd
commit be9113ea3f

View file

@ -61,3 +61,19 @@ Log.log "foo"
or with section (default='frontend'):
Log.log "foo", "importer"
--
Future stuff
------------
A possible migration adding a unique constraint to avoid duplicate images
class AddScreenshotUniqueConstraintImageFingerprint < ActiveRecord::Migration
def change
add_index :screenshots, [:package_id, :image_fingerprint], :unique => true
end
end
A separate validation in the Screenshots model has been implemented already.
This unique constraint would raise an error and not trigger a validation error
properly unless the separate model validation is in place.