The creation of the ER or UML model will require implementing an algorithm to map relational schemas into ER or UML, and to provide some automated layout of the diagram. Existing tools may be used for displaying the diagram (or if you prefer, you may write your own custom drawing tool).
Once created, the user should be able to augment the diagram with 'business rules' in the ERL language [1] (based on first order temporal logic), and the user should then be able to choose if the rule combined with the ER or UML model should be compile into a constraint, view or database trigger/cascade. The tool should check that for consistency between the data model and the rules (specifically that the rule only references objects in the data model) and should only provide to the user valid compilation options for the rule.
References:
[1] P.J. McBrien, M. Niézette, D.Pantazis, A.H. Seltveit, U.Sundin, B. Theodoulidis, G. Tziallas and R. Wohed:A Rule Language to Capture and Model Business Policy Specifications. CAiSE 1991: Spinger-Verlag LNCS 498, pages 307-318, 1991.