Changed database name fields to unique constraints