changes to sql - added media tables