Updated database schema and constraitns