Index: openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html,v diff -u -r1.48 -r1.49 --- openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html 27 Oct 2014 16:39:18 -0000 1.48 +++ openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html 7 Aug 2017 23:47:49 -0000 1.49 @@ -1,5 +1,5 @@ -Constraint naming standard

Constraint naming standard

By Michael Bryzek

+Constraint naming standard

Constraint naming standard

By Michael Bryzek

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

The Big Picture

@@ -9,16 +9,14 @@ with our data model. This gives us two real advantages:

  • We can quickly identify and fix any errors.

  • We can reliabily modify or drop constraints

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.

Abbreviations

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. -

Constraint typeAbbreviation
references (foreign key)fk
uniqueun
primary keypk
checkck
not nullnn

Format of constraint name

+

Constraint typeAbbreviation
references (foreign key)fk
uniqueun
primary keypk
checkck
not nullnn
indexidx

Format of constraint name

<table name>_<column_name>_<constraint abbreviation>

In reality, this won't be possible because of the character limitation on @@ -85,4 +83,4 @@ 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. -

($Id$)
View comments on this page at openacs.org
+

($Id$)