SQL changes

Backup before major SQL changes