setup db code