fixed issue causing failure when generating scripts for tables with primary keys