slight modifications to sql dump also added back in triggers and functions