removed *.sql from gitignore, fixed db functions