Affects Version/s: None
Fix Version/s: None
Reported By: cjheath
Created: 2007-04-23 13:36:43
Last Modified: 2007-04-23 16:13:56
Description: I'm using the generated SQL Server code from the Orienteering model (this version is revised from the one posted in a previous bug report) and there are numerous things that either don't run (incorrect SQL) or are just logical errors. Some of the things I've seen are:
* Value constraints are named the same on every instance of the value type (this is illegal in SQL Server),
* Role names sometimes get used, and sometimes not, in generating names of fields, with the result that foreign key constraints refer to fields that don't exist in the DDL,
* NOT NULL fields are declared as such, but not NULL fields, even though the default can be changed,
* Extenal uniqueness constraints are generated incorrectly. For example:
Entrant has exactly one GivenName
Team is a subclass of Entrant
Competitor is a subclass of Entrant
Competitor has exactly one FamilyName
(Entrant.GivenName, Competitor.FamilyName) is unique.
Because Competitor is absorbed into Entrant, the uniqueness
constraint can be declared as a Unique constraint (but see below),
however it's actually generated as a UC across *just* the FamilyName
field, which is quite wrong.
* Unique constraints across more than one column are generated
assuming the wrong semantics for nullable fields. SQL Server only
allows one instance of a NULL, not any number.
At least some of these errors are not just SQL Server issues, but logical errors in the absorption process.