modified db.py for bigints