Prevent duplicate attachment orderings

Add not null and a unique index on ordering to prevent duplicate
attachment orderings.
Merge pull request #996 from alphagov/prevent-duplicate-attachment-orderings

Prevent duplicate attachment orderings