database.py: Adds missing unique constraint.