Exporting view creates incorect sql files