move chat and session to sqlite