Add primary key for download permissions + upgrade script. Makes working with individual rows easier. #2765