Fixed the database constraints.