Use ORM in upgrade test instead of manual query construction
Use ORM in upgrade test instead of manual query construction

Using manual construction failed for PostgreSQL. ORM is the proper
way for this case.

Change-Id: I5d3fc4a2202bb4b278368edc9d58fc6883b44570

nuxeh/keystone,ajayaa/keystone,nuxeh/keystone,idjaw/keystone,vivekdhayaal/keystone,klmitch/keystone,rajalokan/keystone,cernops/keystone,jamielennox/keystone,vivekdhayaal/keystone,ilay09/keystone,dstanek/keystone,jumpstarter-io/keystone,vivekdhayaal/keystone,cernops/keystone,nuxeh/keystone,roopali8/keystone,ajayaa/keystone,jonnary/keystone,klmitch/keystone,idjaw/keystone,dims/keystone,ilay09/keystone,rajalokan/keystone,dstanek/keystone,dims/keystone,jamielennox/keystone,takeshineshiro/keystone,openstack/keystone,jumpstarter-io/keystone,jonnary/keystone,mahak/keystone,roopali8/keystone,rajalokan/keystone,maestro-hybrid-cloud/keystone,dstanek/keystone,mahak/keystone,ilay09/keystone,jumpstarter-io/keystone,mahak/keystone,maestro-hybrid-cloud/keystone,openstack/keystone,takeshineshiro/keystone,himanshu-setia/keystone,openstack/keystone,himanshu-setia/keystone