Note for future unique constraint on image_fingerprint added
This commit is contained in:
parent
19e51445fd
commit
be9113ea3f
1 changed files with 16 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue