add db constraints & primary keys