changes sql structure