add database constraints