When I deploy an application the order of deployment is;
- Drop and Deploy tables
- Drop and Deploy constraints
- Drop and Deploy indexes.
This order doesn’t allow to create referential constraints on unique candidate keys.
This would become possible, when all required drops would be ordered separately from the creates. The constraints should be dropped before dropping the indexes, and the indexes should be created before creating the constraints.