Fix SQL scripts