Add database schema and logging