ensure ids are always assigned as integers

I had some trouble with ids sometimes being stored as strings... this was a problem, since the ids were stored as integers in the database, so I couldn't retrieve the enum value.
Maybe this is database dependent?