Index: openacs-4/packages/acs-core-docs/www/xml/engineering-standards/constraint-naming.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/engineering-standards/constraint-naming.xml,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-core-docs/www/xml/engineering-standards/constraint-naming.xml 17 Jul 2006 05:38:37 -0000 1.6 +++ openacs-4/packages/acs-core-docs/www/xml/engineering-standards/constraint-naming.xml 7 Aug 2017 23:47:54 -0000 1.7 @@ -29,7 +29,7 @@ Why do we need a naming convention? -Oracle limits names, +Oracle limits names, in general, to 30 characters, which is hardly enough for a human readable constraint name. @@ -40,9 +40,7 @@ We propose the following naming convention for all constraints, with -the following abbreviations taken from Oracle Docs at - -http://oradoc.photo.net/ora81/DOC/server.815/a67779/ch4e.htm#8953. +the following abbreviations taken from Oracle Docs. Note that we shortened all of the constraint abbrevations to two characters to save room. @@ -76,6 +74,11 @@ not null nn + + index + idx + + @@ -89,13 +92,13 @@ -In reality, this won't be possible because of the character limitation on +In reality, this won't be possible because of the character limitation on names inside oracle. When the name is too long, we will follow these two steps in order: - Abbreviate the table name with the table's initials (e.g. users -> u and users_contact -> uc). + Abbreviate the table name with the table's initials (e.g. users -> u and users_contact -> uc). Truncate the column name until it fits. @@ -147,10 +150,10 @@ -Why it's good to name primary keys +Why it's good to name primary keys -Naming primary keys might not have any obvious advantages. However, here's an +Naming primary keys might not have any obvious advantages. However, here's an example where naming the primary key really helps (and this is by no means a rare case! @@ -172,7 +175,7 @@ -Isn't it nice to see "EXAMPLE_TOPICS_TOPIC_ID_PK" in the trace +Isn't it nice to see "EXAMPLE_TOPICS_TOPIC_ID_PK" in the trace and know exactly which table oracle is using at each step? @@ -192,7 +195,7 @@ About Naming the not null constraints -Though naming "not null" constraints doesn't help immeditately in error +Though naming "not null" constraints doesn't help immeditately in error debugging (e.g. the error will say something like "Cannot insert null value into column"), we recommend naming not null constraints to be consistent in our naming of all constraints.