CC-5420 : Upgrade: sql error

incorrect view being created.
Merge branch '2.5.x' of dev.sourcefabric.org:airtime into 2.5.x